Constructs a 200 OK response.
This indicates that the request has succeeded.
body
is the response body. It may be either a String
, a
Stream
, or >
null
to indicate no body. If it's a String
,
encoding
is used to encode it to a Stream
. It defaults to
UTF-8.>
If encoding
is passed, the "encoding" field of the Content-Type header
in headers
will be set appropriately. If there is no existing
Content-Type header, it will be set to "application/octet-stream".
Source
Response.ok(body, {Map<String, String> headers, Encoding encoding,
Map<String, Object> context})
: this(200, body: body, headers: headers, encoding: encoding,
context: context);