querystring
querystring
Parse and stringify HTTP query strings. The Crystal
way! 🎉
Installation
Add this to your application's shard.yml
:
dependencies:
querystring:
github: crystalrealm/querystring
Usage
require "querystring"
QString.parse("?a=2")
# => Hash {"a" => 2}
QString.stringify({"a" => "test", "b" => 2})
# => String "?a=test&b=2"
API
.parse(String)
Parse a query string into a Hash.
The returned object's class equals to Hash(String, Int32 | String | Nil)
.
.stringify(Hash, [options] : Hash)
Stringify a hash into a query string.
The returned object's class equals to String
.
question_mark
Type: boolean
Default: true
Put a question mark (?
) before the query.
Contributing
- 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
Contributors
- szekelymilan Milan Szekely - creator, maintainer
Repository
querystring
Owner
Statistic
- 2
- 0
- 0
- 0
- 0
- about 6 years ago
- August 28, 2018
License
MIT License
Links
Synced at
Thu, 07 Nov 2024 19:15:57 GMT
Languages