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

addContentType(String extension, String mimeType) → void
Adds additional content type for the given extension. Note: it overrides the system default if any.
ajax(Uri url, {String method = "GET", List<int>? data, String? body, Map<String, String>? headers, bool? onResponse(HttpClientResponse response)?}) Future<List<int>?>
Sends an Ajax request to the given url. It returns the data received, or null if error.
deleteAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, bool? onResponse(HttpClientResponse response)?}) Future<List<int>?>
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 fund.
getMimeType(String? path, {List<int>? headerBytes, bool? isExtension, bool autoUtf8 = true}) String?
Retrieves the mime type from the given path and, optional, header bytes (headerBytes). It returns null if not fund.
gzip(List<int> bytes, {int level = 6}) List<int>
Deflates a list of bytes with GZIP.
gzipString(String string, {Encoding encoding = utf8, int level = 6}) List<int>
Deflates a String into a list of bytes with GZIP.
headAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, bool? onResponse(HttpClientResponse response)?}) Future<List<int>?>
Sends an Ajax request to the given url using the HEAD method.
isHttpStatusOK(int? status) bool
Tests whether the status code is a successfully response.
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, bool? onResponse(HttpClientResponse response)?}) Future<List<int>?>
Sends an Ajax request to the given url using the PATCH method.
postAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, bool? onResponse(HttpClientResponse response)?}) Future<List<int>?>
Sends an Ajax request to the given url using the POST method.
putAjax(Uri url, {List<int>? data, String? body, Map<String, String>? headers, bool? onResponse(HttpClientResponse response)?}) Future<List<int>?>
Sends an Ajax request to the given url using the PUT method.
ungzip(List<int> bytes) List<int>
Inflates a GZIP-ed list of bytes back to the original list of bytes.
ungzipString(List<int> bytes, {Encoding encoding = utf8}) String
Inflates a GIZP-ed string back to the original string.