Response constructor

Response(
  1. String body,
  2. int statusCode, {
  3. BaseRequest? request,
  4. Map<String, String> headers = const {},
  5. bool isRedirect = false,
  6. bool persistentConnection = true,
  7. String? reasonPhrase,
})

Creates a new HTTP response with a string body.

Implementation

Response(String body, int statusCode,
    {BaseRequest? request,
    Map<String, String> headers = const {},
    bool isRedirect = false,
    bool persistentConnection = true,
    String? reasonPhrase})
    : this.bytes(_encodingForHeaders(headers).encode(body), statusCode,
          request: request,
          headers: headers,
          isRedirect: isRedirect,
          persistentConnection: persistentConnection,
          reasonPhrase: reasonPhrase);