json_api 4.0.0 json_api: ^4.0.0 copied to clipboard
Framework-agnostic implementations of JSON:API Client (Flutter, Web and VM) and Server (VM). Supports JSON:API v1.0 (http://jsonapi.org)
Client-server interaction example #
Run the server:
$ dart example/server.dart
Listening on http://localhost:8080
This will start a simple JSON:API server at localhost:8080. It supports 2 resource types:
Try opening these links in your browser, you should see empty collections.
While the server is running, try the client script:
$ dart example/client.dart
POST http://localhost:8080/writers
204
POST http://localhost:8080/books
204
GET http://localhost:8080/books/2?include=authors
200
Book: Resource(books:2 {title: Refactoring})
Author: Resource(writers:1 {name: Martin Fowler})
This will create resources in those collections. Try the the following links: