http_query_string 1.0.0 copy "http_query_string: ^1.0.0" to clipboard
http_query_string: ^1.0.0 copied to clipboard

HTTP RFC compliant query string encoder and decoder, compatible with the PHP & jQuery traditional syntax for nested array/objects and multidimensional arrays

http_query_string #

Build status codecov

A RFC1867 compliant query string encoder and decoder, compatible with the PHP & jQuery traditional syntax for nested array/objects.

Inspired by :

import 'package:http_query_string/http_query_string.dart';

void main() {
  var decoder = Decoder();
  print(decoder.convert("foo=bar&list%5B0%5D=bar&list%5B1%5D=foo&list%5B2%5D%5Bkey%5D=value"));
}

Will print out something like that

{
  "foo": "bar",
  "list": [
    "bar",
    "foo",
    {"key": "value"}
  ]
}

And vice versa :

import 'package:http_query_string/http_query_string.dart';

void main() {
  print(Encoder().convert(<String, dynamic>{
      "encode": "bar with space",
      "int": 42,
      "float": 42.367,
      "negative": -23,
      "true": true,
      "false": false,
      "null": null,
      "set": {"a", "b"},
      "list": [
          "bar",
          "foo",
      ],
      "map": {
        "key": "value"
      },
  }));
}

Will output

'encode=bar+with+space&int=42&float=42.367&negative=-23&true=1&false=0&set%5B0%5D=a&set%5B1%5D=b&list%5B0%5D=bar&list%5B1%5D=foo&map%5Bkey%5D=value'
2
likes
130
pub points
81%
popularity

Publisher

unverified uploader

HTTP RFC compliant query string encoder and decoder, compatible with the PHP & jQuery traditional syntax for nested array/objects and multidimensional arrays

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

args

More

Packages that depend on http_query_string