fnx_rest_browser library
Developer and Angular 2 friendly REST client. Do this:
RestClient root = HttpRestClient.root("http://myapi.example/api/v1");
... and start using it. See RestClient for more information.
Classes
- Accepts
- Couple of mime type and Deserializer.
- BrowserHttpClient
- BrowserRestClient
- HttpException
- ListResultDriver
- Expects the API to return a Map with 'data' attribute which contains the actual List of results
- Produces
- Couple of mime type and Serializer.
- RestClient
-
The rest client, this is the class you want to use.
On web use the
HttpRestClient.root
constructor to obtain preconfigured RestClient. - RestHttpClient
- Create your own implementation of this class if you need to inject your own HTTP client into RestClient. On server, for example. See RestClient.
- RestListing
- Simple utility which allows to load pages of results for a given API endpoint
- RestListingDriver
- Allows to hook into the process of requesting data from the API and then unwrapping List of results from provided response
- RestResult
- Result of REST call.
- SimpleListDriver
- Expects the API to return List of data directly in its response.
- UnpackedData
- Contains the data itself and flag whether we think (or know) that there is more data to fetch (next page)
- UrlParseResult
Properties
- defaultBinaryDeserializer ↔ Deserializer
-
getter/setter pair
- defaultBinarySerializer ↔ Serializer
-
getter/setter pair
- defaultJsonDeserializer ↔ Deserializer
-
Uses JSON.decode(...) from dart:convert.
getter/setter pair
- defaultJsonSerializer ↔ Serializer
-
Uses JSON.encode(...) from dart:convert.
getter/setter pair
- microRemoval ↔ RegExp
-
getter/setter pair
Functions
-
toJsonEncodable(
Object? value) → Object?
Typedefs
- Deserializer = dynamic Function(Response response)
- Defines function which is able to take HTTP response and deserialize, possibly into a Dart object. Should return a String or List
-
Serializer
= dynamic Function(dynamic payload, Map<
String, String> requestHeaders) - Defines function which si able to take Dart objects and serialize them for upload (POST, PUT).