HttpProtocolService class
HTTP-like protocol service
Constructors
- HttpProtocolService.new(Host host)
Properties
Methods
-
addRoute(
HttpMethod method, String path, HttpRequestHandler handler) → void - Add a route handler
-
delete(
String path, HttpRequestHandler handler) → void -
get(
String path, HttpRequestHandler handler) → void - Convenience methods for common HTTP methods
-
getRequest(
PeerId peerId, String path, {Map< String, String> ? headers}) → Future<HttpResponse> - Convenience methods for making requests
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post(
String path, HttpRequestHandler handler) → void -
postJson(
PeerId peerId, String path, Map< String, dynamic> data) → Future<HttpResponse> -
postRequest(
PeerId peerId, String path, {Map< String, String> ? headers, Uint8List? body}) → Future<HttpResponse> -
put(
String path, HttpRequestHandler handler) → void -
request(
PeerId peerId, HttpMethod method, String path, {Map< String, String> ? headers, Uint8List? body, Duration? timeout}) → Future<HttpResponse> - Make an HTTP request to a peer
-
setDefaultHeader(
String key, String value) → void - Set default headers that will be added to all responses
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited