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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8df2bebdf1781bae2315f64b8dd0f28b86da978ef33719a0c4b78c78d42c8f67
4
- data.tar.gz: 05e11c172e6ec2e1739e33fb06b312d4070ba9b51a0d8b7db91068b43e73b8e5
3
+ metadata.gz: ff6f21a5d32517b181da4afeaf817fa5018d4ff2414f043deefbfe5088ca414a
4
+ data.tar.gz: dec4e21353b5146a2909523b54a700e4d647932a45ceae58c79363984323100a
5
5
  SHA512:
6
- metadata.gz: f81761dfa105cb2372101f4464d977cd7ac86883a6fc5161933c9d7848fe8beff04d7da5af98737cf233e647c77fa82e2527e0c7e9cc7ed4cf3e905b222ac332
7
- data.tar.gz: 87b979e0f709241a30cbb0fb6d2b5aaca2eaf24af5916aa26bf8560219d7ec54d367e61dadb85ee628928ed2bf34c6bfc12c755901d524a20fee05c7381131ef
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
@@ -194,7 +194,6 @@ module NiceHttpManageResponse
194
194
  @logger.fatal stack
195
195
  @logger.fatal "manage_response Error on method #{method_s} "
196
196
  end
197
-
198
197
  @start_time = nil
199
198
  end
200
199
 
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.20
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-05 00:00:00.000000000 Z
11
+ date: 2019-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nice_hash