requests 1.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new79

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.1

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");

1.0.0 #

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  requests: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:requests/requests.dart';
  
Version Uploaded Documentation Archive
1.0.2 Feb 17, 2019 Go to the documentation of requests 1.0.2 Download requests 1.0.2 archive
1.0.1 Feb 8, 2019 Go to the documentation of requests 1.0.1 Download requests 1.0.1 archive
1.0.0 Jan 31, 2019 Go to the documentation of requests 1.0.0 Download requests 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
65
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
82
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13+1
  • Flutter: 1.2.1

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

22 out of 22 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/requests.dart.

Run flutter format to format lib/requests.dart.

Format lib/src/event.dart.

Run flutter format to format lib/src/event.dart.

Format lib/src/requests.dart.

Run flutter format to format lib/src/requests.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and requests.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
crypto ^2.0.6 2.0.6
flutter 0.0.0
hex ^0.1.2 0.1.2
http ^0.12.0 0.12.0+1
logging ^0.11.3+2 0.11.3+2
preferences ^1.2.0 1.3.0
shared_preferences ^0.4.3 0.4.3 0.5.1+1
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.2
sky_engine 0.0.99
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
pedantic ^1.0.0
test ^1.0.0