jaguar_resty 1.1.9 jaguar_resty: ^1.1.9 copied to clipboard
Build fluent functional Restful clients
jaguar_resty #
Build fluent functional Restful clients
Features #
- Fluent API to set:
- ✅ Hierarchical paths
- ✅ Query parameters
- ✅ Headers
- ✅ Body
- ✅ Client
- ✅ JSON request encoding
- ✅ JSON request decoding
- ✅ URL encoded forms
- ✅ Multipart form
- ❌ Cookie jar
- ❌ Interceptors
- ❌ Authenticators
Usage #
Simple GET request #
Book book = await resty.get('/book/1').fetch(Book.map);
Add query parameters #
Book book = await resty.get('/book').query('page', '2').fetchList(Book.map);
Add headers #
Book book = await resty.get('/book').header('page', '2').fetch(Book.map);
JSON request encoding #
Book book = await resty.post('/book').json(new Book('1', 'Harry potter'))
.fetch(Book.map);
JSON response decoding #
Book book = await resty.get('/book/1').fetch(Book.map);
URL encoded forms #
// TODO WIP
Multipart form #
// TODO WIP