Para utilizar o Body parser você dever importar a biblioteca
Passe a request no contrutor da classe e chame o Parser, para fazer o parser inteiro da request. Para pegar apenas um parametro na request você deve apenas utilizar o metodo "GetParser()" passando o parametro para a mesma.
import 'dart:io' show HttpRequest; import 'dart:BodyParser';
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: body_parser_json: ^1.0.0
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Nov 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.12.21
Detected platforms: Flutter, other
Health issues and suggestions
lib/body_parser_json.dart. (-44.31 points)
lib/body_parser_json.dart failed with 2 errors, 2 hints:
line 10 col 48: The argument type 'Utf8Decoder' can't be assigned to the parameter type 'StreamTransformer<Uint8List, dynamic>'.
line 15 col 48: The argument type 'Utf8Decoder' can't be assigned to the parameter type 'StreamTransformer<Uint8List, dynamic>'.
line 18 col 7: DO use curly braces for all flow control structures.
line 20 col 7: DO use curly braces for all flow control structures.
Document public APIs. (-1 points)
7 out of 7 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.
Maintenance issues and suggestions
Homepage URL doesn't exist. (-20 points)
At the time of the analysis the
https://github.com/Militao36/BodyParser was unreachable.
The analyzer can't parse
The package description is too short. (-20 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.
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
body_parser_json.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.1.0 <3.0.0|