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.
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.
Functions
ajax (Uri url , {String method = "GET" , List <int > ? data , String ? body , Duration ? timeout })
→ Future <Response >
Sends an Ajax request to the given url and returns the response.
decodePostedParameters (Stream <List <int > > request , {Map <String , String > ? parameters , int ? maxLength })
→ Future <Map <String , String > >
Decodes the parameters of the POST request.
decodeQueryString (String queryString , {Map <String , String > ? parameters })
→ Map <String , String >
Decodes the query string into a map of name-value pairs (aka., parameters).
deleteAjax (Uri url , {List <int > ? data , String ? body , Duration ? timeout })
→ Future <Response >
Sends an Ajax request to the given url using the DELETE method.
encodeQueryString (Map <String , dynamic > parameters )
→ String
Encodes the given parameters into a query string.
Notice the returned string won't start with '?'.
getContentType (String ? path , {bool ? isExtension , bool autoUtf8 = true })
→ ContentType ?
Returns ContentType of the specified path, or null
if not found.
getMimeType (String ? path , {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 , {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 , Duration ? timeout })
→ Future <Response >
Sends an Ajax request to the given url using the PATCH method.
postAjax (Uri url , {List <int > ? data , String ? body , Duration ? timeout })
→ Future <Response >
Sends an Ajax request to the given url using the POST method.
putAjax (Uri url , {List <int > ? data , String ? body , 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" , int ? contentLength , Duration ? timeout })
→ Future <Response >
Sends a request with a streamed body and returns the response.
streamedResponseAjax <T > (Uri url , Future <T > onResponse (StreamedResponse resp ), {String method = "GET" , List <int > ? data , String ? body , Duration ? timeout })
→ Future <T >
Sends a request and lets the caller read the response body
incrementally instead of buffering it — the streaming-response
counterpart to ajax (e.g. for Server-Sent Events / chunked
responses).