formler 1.0.0

  • README.md
  • Installing
  • Versions
  • 41

Build Status

formler

[![Join the chat at https://gitter.im/Daegalus/formler](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Daegalus/formler?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Simple form data parser.

Features:

Getting Started

Pubspec

pub.dartlang.org: (you can use 'any' instead of a version if you just want the latest always)

dependencies:
  formler: 1.0.0
import 'package:formler/formler.dart';

Start parsing ...

// Parse a Multipart form
Formler formler = new Formler(bytes, "--someBoundaryStuff");
Map form = formler.parse(); // -> {fieldName: .... }

// Parse a UrlEncoded form
Formler.parseUrlEncoded("username=someValue+other%26val&password=eqwdawd9"); // -> { "username": "someValue other&val", "password": "eqwdawd9" }

API

new Formler(List<int> bytes, String boundary)

Creates a new Formler instance with the byte contents of the request and the boundary from the contentType.

  • bytes - (List<int>) A list of bytes respresnting the POST form data.

Returns the new instance of Formler.

formler.parse()

Actually does the parsing of the data and creates the data map of the contents.

Returns Map representation of the parsed data.

(static) Formler.parseUrlEncoded(String postBody, [bool printErrors = true])

Parses a UrlEncoded post body string.

  • postBody - (String) A string of key/urlencoded value pairs.
  • printErrors - (Bool) Set to false if you don't want Formler to print warnings to STDOUT. Default is true.

Returns Map representation of the parsed Data

Example: Encode a hex string.

Testing

In dartvm

dart test\formler_test.dart

In Browser

At the moment, this package does not work client-side as it uses server-side only UInt8Lists. I might have to wait till UInt8Arrays and UInt8Lists are merged into 1

Release notes

v0.1.2

  • Pull Request accepted to fix package versions for increased compatibility.

v0.1.1

  • Fix empty string and handle malformed urlencoded strings gracefully.

v0.1.0

  • Dart 1.0 Readiness

v0.0.8

  • Fixing analyzer complaints.

v0.0.7

  • Fixing package changes for Crypto and URI

v0.0.6

  • Including fixes for TypedData and Regex and also switched to useing the Base64 Decode built into Crypto now.

v0.0.5

  • Accepted pull request to add multi-file support. Must have overlooked this in my excitement to get this parser working.

v0.0.4

  • Fixing an import/part issue that affected Fukiya.

v0.0.3

  • Binary file upload parsing bug fixed.

v0.0.2

  • Parsing Bugs.

v0.0.1

  • Initial Release

Use this package as a library

1. Depend on it

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


dependencies:
  formler: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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:formler/formler.dart';
  
Version Uploaded Documentation Archive
1.0.0 Sep 2, 2018 Go to the documentation of formler 1.0.0 Download formler 1.0.0 archive
0.1.2 Oct 9, 2015 Go to the documentation of formler 0.1.2 Download formler 0.1.2 archive
0.1.1 Oct 7, 2015 Go to the documentation of formler 0.1.1 Download formler 0.1.1 archive
0.1.0 Nov 9, 2013 Go to the documentation of formler 0.1.0 Download formler 0.1.0 archive
0.0.8 Jun 5, 2013 Go to the documentation of formler 0.0.8 Download formler 0.0.8 archive
0.0.7 Jun 5, 2013 Go to the documentation of formler 0.0.7 Download formler 0.0.7 archive
0.0.6 May 6, 2013 Go to the documentation of formler 0.0.6 Download formler 0.0.6 archive
0.0.5 Apr 7, 2013 Go to the documentation of formler 0.0.5 Download formler 0.0.5 archive
0.0.4 Mar 30, 2013 Go to the documentation of formler 0.0.4 Download formler 0.0.4 archive
0.0.3 Mar 27, 2013 Go to the documentation of formler 0.0.3 Download formler 0.0.3 archive

All 12 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
41
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:formler/formler.dart.

Health issues and suggestions

Document public APIs (-10 points)

28 out of 28 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Maintenance issues and suggestions

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use formler.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
logging >=0.9.3 <0.12.0 0.11.3+2
Dev dependencies
test any