Represents an HTTP request to be processed by a Shelf application.

Inheritance
  • Object
  • Message
  • Request

Constructors

Request(String method, Uri requestedUri, {String protocolVersion, Map<String, String> headers, String handlerPath, Uri url, body, Encoding encoding, Map<String, Object> context, OnHijackCallback onHijack(HijackCallback callback(Stream<List<int>> stream, StreamSink<List<int>> sink))})

Creates a new Request.

Properties

canHijack → bool

Whether this request can be hijacked.

read-only
contentLength → int

The contents of the content-length field in headers.

read-only, inherited
context → Map<String, Object>

Extra context that can be used by for middleware and handlers.

read-only, inherited
encoding → Encoding

The encoding of the message body.

read-only, inherited
handlerPath → String

The URL path to the current handler.

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
headers → Map<String, String>

The HTTP headers.

read-only, inherited
ifModifiedSince → DateTime

If this is non-null and the requested resource hasn't been modified since this date and time, the server should return a 304 Not Modified response.

read-only
method → String

The HTTP request method, such as "GET" or "POST".

read-only
mimeType → String

The MIME type of the message.

read-only, inherited
protocolVersion → String

The HTTP protocol version used in the request, either "1.0" or "1.1".

read-only
requestedUri → Uri

The original Uri for the request.

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
url → Uri

The URL path from the current handler to the requested resource, relative to handlerPath, plus any query parameters.

read-only

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

change({Map<String, String> headers, Map<String, Object> context, String path, body}) Request

Creates a new Request by copying existing values and applying specified changes.

hijack(HijackCallback callback(Stream<List<int>> stream, StreamSink<List<int>> sink)) → void

Takes control of the underlying request socket.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
read() → Stream<List<int>>

Returns a Stream representing the body.

inherited
readAsString([Encoding encoding]) → Future<String>

Returns a Future containing the body as a String.

inherited
toString() → String

Returns a string representation of this object.

inherited