raw property

HttpRequest raw
final

The underlying HttpRequest of this instance.

Use this property to access values from the HTTP request that aren't accessible through this instance.

You should typically not manipulate this property's HttpRequest.response. By default, Conduit controls the response through its Controllers.

If you wish to respond to a request manually - and prohibit Conduit from responding to the request - you must remove this instance from the request channel. To remove a request from the channel, return null from a Controller handler method instead of a Response or Request. For example:

    router.route("/raw").linkFunction((req) async {
      req.response.statusCode = 200;
      await req.response.close(); // Respond manually to request
      return null; // Take request out of channel; no subsequent controllers will see this request.
    });

Implementation

final HttpRequest raw;