HttpTranslator class
Serves to configure HTTP requests for posting, and translates the corresponding responses.
This is an extension point for users of Client API. Custom HttpTranslator implementation, once set, may serve as an adapter to the circumstances, under which the server-side of the application is running.
Please note, that API of this type includes the seemingly unused parameter of type URI
.
It is a design decision, allowing the descendants of this type (i.e. those wishing
to set their custom HttpTranslator
) to have more control over which translation
strategy to apply depending on the server endpoint.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
body(
Uri uri, GeneratedMessage message) → String -
Transforms the given
message
into String which is used as HTTP POST body bypostMessage
, when the request is about to be sent touri
. -
headers(
Uri uri) → Map< String, String> -
Returns HTTP request headers to use in
postMessage
, when configuring the request to send touri
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
translate<
T extends GeneratedMessage> (Uri uri, String responseBody, T destination) → T -
Translates the HTTP response body into an object of type
T
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited