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';
Add this to your package's pubspec.yaml file:
dependencies: body_parser_json: ^1.0.0
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.
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 Aug 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
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.
lib/body_parser_json.dart. (-1 points)
lib/body_parser_json.dart reported 2 hints:
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.
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|