File tree 1 file changed +32
-2
lines changed
1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change 1
1
# querystring
2
2
3
- TODO: Write a description here
3
+ [ ![ Open Source Love] ( https://img.shields.io/badge/Open%20Source-%E2%9D%A4-%23ff2520.svg )] ( https://shields.io )
4
+ [ ![ License] ( https://img.shields.io/github/license/crystalrealm/querystring.svg )] ( https://shields.io )
5
+ [ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( http://makeapullrequest.com )
6
+ [ ![ Build Status] ( https://travis-ci.com/crystalrealm/querystring.svg?branch=master )] ( https://travis-ci.com/crystalrealm/querystring )
7
+
8
+ Parse and stringify HTTP query strings. The ` Crystal ` way! :tada :
4
9
5
10
## Installation
6
11
@@ -16,9 +21,34 @@ dependencies:
16
21
17
22
` ` ` crystal
18
23
require "querystring"
24
+
25
+ QString.parse("?a=2")
26
+ # => Hash {"a" => 2}
27
+
28
+ QString.stringify({"a" => "test", "b" => 2})
29
+ # => String "?a=test&b=2"
19
30
```
20
31
21
- TODO: Write usage instructions here
32
+ ## API
33
+
34
+ ### .parse(* String* )
35
+
36
+ Parse a query string into a Hash.
37
+
38
+ The returned object's class equals to ` Hash(String, Int32 | String | Nil) ` .
39
+
40
+ ### .stringify(* Hash* , * [ options] : Hash* )
41
+
42
+ Stringify a hash into a query string.
43
+
44
+ The returned object's class equals to ` String ` .
45
+
46
+ #### question_mark
47
+
48
+ Type: ` boolean ` <br >
49
+ Default: ` true `
50
+
51
+ Put a question mark (` ? ` ) before the query.
22
52
23
53
## Contributing
24
54
You can’t perform that action at this time.
0 commit comments