RestClient class
The rest client, this is the class you want to use.
On web use the HttpRestClient.root
constructor to obtain preconfigured
RestClient.
- Implementers
Constructors
-
RestClient(RestHttpClient httpClient, RestClient? parent, String url, {Map<
String, String> ? headers})
Properties
- acceptsMime → String?
-
no setter
- deserializer → Deserializer?
-
no setter
- effAccepts → Accepts?
-
no setter
- effProduces → Produces?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
no setter
-
params
→ Map<
String, dynamic> -
no setter
- producesMime → String?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serializer → Serializer?
-
no setter
- url → String
-
no setter
- urlWithParams → String
-
no setter
- working → bool
-
no setter
-
workingStream
→ Stream<
bool> -
no setter
Methods
-
accepts(
String mime, Deserializer deserializer) → RestClient - Configure Accept header with appropriate Deserializer.
-
acceptsBinary(
String mime) → RestClient - Configure Accept header to receive binary data without any processing.
-
child(
String urlPart, {Map< String, String> ? headers}) → RestClient -
delete(
{dynamic data, Map< String, String> ? headers}) → Future<RestResult> - HTTP DELETE with optional additional headers and optional body
-
get(
{dynamic data, Map< String, String> ? headers}) → Future<RestResult> - HTTP get with optional additional headers and optional body.
-
getParam(
String name) → String? -
getParams(
String name) → List< String> ? -
handleResponse(
Future< Response> resp) → Future<RestResult> -
head(
{Map< String, String> ? headers}) → Future<RestResult> - HTTP HEAD with optional additional headers.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
dynamic data, {Map< String, String> ? headers}) → Future<RestResult> - HTTP POST with optional additional headers. Data will be processed using configured Serializer, JSON.encode(...) by default.
-
post(
dynamic data, {Map< String, String> ? headers}) → Future<RestResult> - HTTP POST with optional additional headers. Data will be processed using configured Serializer, JSON.encode(...) by default.
-
produces(
String mime, Serializer serializer) → RestClient - Configure Content-Type header with appropriate Serializer.
-
producesBinary(
String mime) → RestClient - Configure Content-Type header to submit data as List
-
put(
dynamic data, {Map< String, String> ? headers}) → Future<RestResult> - HTTP PUT with optional additional headers. Data will be processed using configured Serializer, JSON.encode(...) by default.
-
removeHeader(
String name) → RestClient - Remove additional header. Will be inherited by all children.
-
setHeader(
String name, String value) → RestClient - Configure additional header. Will be inherited by all children.
-
setParam(
String name, String value) → RestClient - Add query parameter.
-
setParams(
String name, List< String> value) → RestClient - Add query parameter.
-
streamedRequest(
String method, int contentLength, Stream uploadStream, {required Map< String, String> headers}) → Future<RestResult> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- SLASH_CHAR ↔ RegExp
-
getter/setter pair