Skip to content

Commit 1f18adf

Browse files
committed
Update README
1 parent 642a998 commit 1f18adf

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# querystring
22

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:
49

510
## Installation
611

@@ -16,9 +21,34 @@ dependencies:
1621
1722
```crystal
1823
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"
1930
```
2031

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.
2252

2353
## Contributing
2454

0 commit comments

Comments
 (0)