nice_http 1.7.20 → 1.7.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/lib/nice_http/http_methods.rb +4 -0
- data/lib/nice_http/manage_response.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff6f21a5d32517b181da4afeaf817fa5018d4ff2414f043deefbfe5088ca414a
|
4
|
+
data.tar.gz: dec4e21353b5146a2909523b54a700e4d647932a45ceae58c79363984323100a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 309592a50980b97b4bfd72f8fcc7fd8606f32a3559e4617fd67a1cb71d1021b617ea9400ee2201cd206121f091e7b93a0c599e71544bfa4cfe676f25097df100
|
7
|
+
data.tar.gz: 77dfa504bda7bd7b490da6abd2b74eb973cc00fe6282fa8fb0abba6a6be08ce1205495591e7e7bbbc8fdc484a027a65b0663f64be159339a110eec2343e8df1a
|
data/README.md
CHANGED
@@ -35,6 +35,7 @@ Example that creates 1000 good random and unique requests to register an user an
|
|
35
35
|
- [Tips](#Tips)
|
36
36
|
- [Download a file](#Download-a-file)
|
37
37
|
- [Send multipart content](#Send-multipart-content)
|
38
|
+
- [Send x-www-form-urlencoded](#Send-x-www-form-urlencoded)
|
38
39
|
- [Contributing](#Contributing)
|
39
40
|
- [License](#License)
|
40
41
|
|
@@ -639,6 +640,18 @@ Example posting a csv file:
|
|
639
640
|
|
640
641
|
```
|
641
642
|
|
643
|
+
### Send x-www-form-urlencoded
|
644
|
+
|
645
|
+
``` ruby
|
646
|
+
request = {
|
647
|
+
headers: { 'Content-Type': "application/x-www-form-urlencoded"},
|
648
|
+
path: "/register",
|
649
|
+
data: {
|
650
|
+
"firstname": "test@example.com",
|
651
|
+
"lastname": "example"
|
652
|
+
}
|
653
|
+
}
|
654
|
+
```
|
642
655
|
|
643
656
|
## Contributing
|
644
657
|
|
@@ -198,6 +198,10 @@ module NiceHttpHttpMethods
|
|
198
198
|
arguments[0][:data].add_field(key, value) #add to Headers
|
199
199
|
}
|
200
200
|
resp = @http.request(arguments[0][:data])
|
201
|
+
elsif headers_t["Content-Type"].include?("application/x-www-form-urlencoded")
|
202
|
+
encoded_form = URI.encode_www_form(arguments[0][:data])
|
203
|
+
resp = @http.request_post(path, encoded_form, headers_t)
|
204
|
+
data = resp.body
|
201
205
|
else
|
202
206
|
resp = @http.post(path, data, headers_t)
|
203
207
|
data = resp.body
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nice_http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nice_hash
|