Skip to content
No description, website, or topics provided.
Dart Java Objective-C
Branch: master
Clone or download

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)


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

  requests: ^2.0.1


in your Dart code, you can use:

import 'package:requests/requests.dart';

HTTP get, body as plain text

String body = await Requests.get("");

HTTP get, body as parsed json

dynamic body = await Requests.get("", json: true);

HTTP post, body is map or a list (being sent as application/x-www-form-urlencoded, until stated otherwise in bodyEncoding parameter), result is json

dynamic body = await"", json: true, body: {"foo":"bar"} );

HTTP delete

await Requests.delete("");
You can’t perform that action at this time.