io library

Classes

AbstractBufferedResponse
A skeletal implementation for buffered HTTP response, that is, the output will be buffered.
BufferedResponse
A buffered HTTP response that stores the output in the given list of bytes buffer rather than the original HttpResponse instance.
HttpHeadersWrapper
The HTTP headers wrapper.
HttpRequestWrapper
The HTTP request wrapper.
HttpResponseWrapper
The HTTP response wrapper.
HttpUtil
HTTP related utilities
IOSinkWrapper
The IOSink wrapper.
StringBufferedResponse
A buffered HTTP response that stores the output in the given string buffer rather than the original HttpResponse instance.

Constants

dartSessionId → const String
The cookie's name for holding Dart session ID.

Functions

ajax(Uri url, {String method = "GET", List<int>? data, String? body, Map<String, String>? headers, Duration? timeout}) Future<Response>
Sends an Ajax request to the given url and returns the response.
deleteAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, Duration? timeout}) Future<Response>
Sends an Ajax request to the given url using the DELETE method.
getContentType(String? path, {List<int>? headerBytes, bool? isExtension, bool autoUtf8 = true}) ContentType?
Returns ContentType of the specified path, or null if not found.
getMimeType(String? path, {List<int>? headerBytes, bool? isExtension, bool autoUtf8 = true}) String?
Retrieves the mime type from the given path and, optionally, header bytes (headerBytes). It returns null if not found.
headAjax(Uri url, {Map<String, String>? headers, Duration? timeout}) Future<Response>
Sends an Ajax request to the given url using the HEAD method.
isHttpStatusOK(int? status) bool
Whether the HTTP status code is a successful response (2xx range). Null, redirects (3xx), informational (1xx), and error codes return false.
isResponseOK(Response resp) bool
Shortcut for isHttpStatusOK(resp.statusCode).
parseContentType(String value) ContentType
Returns an instance of ContentType of the given mime type, such as text/html; charset=utf-8.
patchAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, Duration? timeout}) Future<Response>
Sends an Ajax request to the given url using the PATCH method.
postAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, Duration? timeout}) Future<Response>
Sends an Ajax request to the given url using the POST method.
putAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, Duration? timeout}) Future<Response>
Sends an Ajax request to the given url using the PUT method.
streamedAjax(Uri url, Future send(EventSink<List<int>> sink), {String method = "GET", Map<String, String>? headers, int? contentLength, Duration? timeout}) Future<Response>
Sends a request with a streamed body and returns the response.