requests 1.0.1 copy "requests: ^1.0.1" to clipboard
requests: ^1.0.1 copied to clipboard

outdated

A starting point for Dart libraries or applications.

flutter http json with cookies #

a flutter library to do modern http requests with cookies(inspired by python's requests module).

server side cookies (via response header SET-COOKIE) are stored using the assistance of shared_preferences. Stored cookies will be send seemlessly on the next http requests you make to the same domain (simple implementation, similar to a web browser)

Install #

Add this to your package's pubspec.yaml file:

dependencies:
  requests: ^1.0.0

Usage #

in your Dart code, you can use:

import 'package:requests/requests.dart';

HTTP get, body as plain text

String body = await Requests.get("https://mydomain.com");

HTTP get, body as parsed json

dynamic body = await Requests.get("https://mydomain.com/api/v1/foo", json: true);

HTTP post, body is json, result is json

dynamic body = await Requests.post("https://mydomain.com/api/v1/foo", json: true, body: {"foo":"bar"} );

HTTP delete

await Requests.delete("https://mydomain.com/api/v1/foo/123");
101
likes
0
pub points
91%
popularity

Publisher

unverified uploader

A starting point for Dart libraries or applications.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, flutter, hex, http, logging, preferences, shared_preferences

More

Packages that depend on requests