flutter_rest_http 0.0.1 copy "flutter_rest_http: ^0.0.1" to clipboard
flutter_rest_http: ^0.0.1 copied to clipboard

Easily integrate to json based rest APIs.

About Package #

Simple package to integrate to JSON based rest API

Getting started #

Run the following command to install the package in your project

flutter pub get flutter_rest_http

Usage #

1. Initialization #

In your main method in lib/main.dart add the following block

void main(){
    RestHttp.init(
        baseURL: "https://jsonplaceholder.typicode.com/"
    );
}

2. Make GET Request #

RestHttp.get("posts").then((res) {
    //handle response
}).catchError((err, stack) {
   //handle errors
});

3. Make POST Request #

RestHttp.post("posts", params: {
    "title": "New post",
    "body": "Post description body"
}).then((res) {
    //handle response
}).catchError((err, stack) {
   //handle errors
});
1
likes
130
pub points
0%
popularity

Publisher

unverified uploader

Easily integrate to json based rest APIs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on flutter_rest_http