AngelHttp class
Adapts dart:io
's HttpServer to serve Angel.
- Inheritance
-
- Object
- Driver<
HttpRequest, HttpResponse, HttpServer, HttpRequestContext, HttpResponseContext> - AngelHttp
Constructors
- AngelHttp(Angel app, {bool useZone = true})
-
factory
-
AngelHttp.custom(Angel app, ServerGeneratorType serverGenerator, {bool useZone = true, Map<
String, String> headers = const {}}) -
An instance mounted on a server started by the
serverGenerator
.factory - AngelHttp.fromSecurityContext(Angel app, SecurityContext context, {bool useZone = true})
-
factory
- AngelHttp.secure(Angel app, String certificateChainPath, String serverKeyPath, {String? password, bool useZone = true})
-
Creates an HTTPS server.
factory
Properties
- app → Angel
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- server ↔ HttpServer?
-
The native server running this instance.
getter/setter pairinherited
-
serverGenerator
→ Future<
HttpServer> Function(dynamic, int) -
The function used to bind this instance to a server..
finalinherited
- uri → Uri
-
The path at which this server is listening for requests.
no setteroverride
- useZone → bool
-
finalinherited
Methods
-
addCookies(
HttpResponse response, Iterable< Cookie> cookies) → void -
override
-
addResponseHeader(
Map< String, Object> headers) → void - Add headers to HTTP Response
-
close(
) → Future< void> -
Shuts down the underlying server.
override
-
closeResponse(
HttpResponse response) → Future -
override
-
createRequestContext(
HttpRequest request, HttpResponse response) → Future< HttpRequestContext> -
override
-
createResponseContext(
HttpRequest request, HttpResponse response, [HttpRequestContext? correspondingRequest]) → Future< HttpResponseContext> -
override
-
createResponseStreamFromRawRequest(
HttpRequest request) → Stream< HttpResponse> -
override
-
generateServer(
dynamic address, int port) → Future< HttpServer> -
inherited
-
handleAngelHttpException(
AngelHttpException e, StackTrace st, RequestContext? req, ResponseContext? res, HttpRequest request, HttpResponse response, {bool ignoreFinalizers = false}) → Future -
Handles an AngelHttpException.
inherited
-
handleRawRequest(
HttpRequest request, HttpResponse response) → Future -
Handles a single request.
inherited
-
handleRequest(
HttpRequest request) → Future -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeResponseHeader(
Map< String, Object> headers) → void - Remove headers from HTTP Response
-
sendResponse(
HttpRequest request, HttpResponse response, RequestContext req, ResponseContext res, {bool ignoreFinalizers = false}) → Future -
Sends a response.
inherited
-
setChunkedEncoding(
HttpResponse response, bool value) → void -
override
-
setContentLength(
HttpResponse response, int length) → void -
override
-
setHeader(
HttpResponse response, String key, String value) → void -
override
-
setStatusCode(
HttpResponse response, int value) → void -
override
-
startServer(
[dynamic address, int port = 0]) → Future< HttpServer> -
Starts, and returns the server.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeStringToResponse(
HttpResponse response, String value) → void -
override
-
writeToResponse(
HttpResponse response, List< int> data) → void -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited