Parse and stringify HTTP query strings. The Crystal
way! 🎉
Add this to your application's shard.yml
:
dependencies:
querystring:
github: crystalrealm/querystring
require "querystring"
QString.parse("?a=2")
# => Hash {"a" => 2}
QString.stringify({"a" => "test", "b" => 2})
# => String "?a=test&b=2"
Parse a query string into a Hash.
The returned object's class equals to Hash(String, Int32 | String | Nil)
.
Stringify a hash into a query string.
The returned object's class equals to String
.
Type: boolean
Default: true
Put a question mark (?
) before the query.
- Fork it (https://github.com/crystalrealm/querystring/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- szekelymilan Milan Szekely - creator, maintainer