l6_http 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b6da77ae074bef168d5c2f958c330f2e4cc6e137092a639abbc47751ea44703
4
- data.tar.gz: 950ccf0b04871b8cdd49282cb6786b4c5810ef18b16df38dec90dd087b7c9348
3
+ metadata.gz: c219e160fc1acb88a74ddc7373a3045ef15dbc6aa5462586680ef4901c5b6e48
4
+ data.tar.gz: 0cbe59a186ff5d0128c62fe794d90303c5c04ade5628c7cb477e1410f52fe531
5
5
  SHA512:
6
- metadata.gz: 5b5e5218bd3bb9c0eaf8a5207b79ad08faa5072aa054184eef47049598ef26b8e2b4518769ab248787993a8200ebb500a0b979ab3077d536ed9870fe7dd0d8d4
7
- data.tar.gz: c40fd92520d40a1ec8fcc63307b79c83e9d4877c347e93f20aa12739aead9a479430ace082a1065971203876066b4ba3632b1744dd550991f0ad6d5da0e2d97a
6
+ metadata.gz: d7a0851861232062aa79a20b7d6e53ff6b4187da853e22b5394343ea5b819df25d64e0a6244b98334b496f7f12751291f94e910eec50226cf32c3495455dcbd6
7
+ data.tar.gz: e77e35ea9c953b78705f3caa86e507ce900f27406a198f440333d80f7a564590291e495ddf04f11dbf5a6dc6a4312fbdadacfa4855d78579757cb2546535735f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- http_client (0.1.0)
4
+ l6_http (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -27,7 +27,7 @@ PLATFORMS
27
27
 
28
28
  DEPENDENCIES
29
29
  bundler (~> 1.16)
30
- http_client!
30
+ l6_http!
31
31
  rake (~> 10.0)
32
32
  rspec (~> 3.0)
33
33
 
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # HttpClient
1
+ # L6_Http
2
2
 
3
- version: only json;
3
+ * Gem to make request using http protocol
4
+
5
+ version: 0.1.0;
4
6
 
5
7
  ## Installation
6
8
 
@@ -19,42 +21,47 @@ Or install it yourself as:
19
21
  $ gem install l6_http
20
22
 
21
23
  ## Usage
22
-
23
- #http
24
- res = Http.new(url_base).get("method",params)
25
-
26
- #https
27
- res = Https.new(url_base).get("method")
28
- res = Https.new(url_base).post("method",params,body)
29
- res = Https.new(url_base).post_without_params("method",body)
30
- header = {"Content-Type":"application/json","cache-control":"no-cache"}
31
- body = {"email":"nome@email.com","password":"pass121"}
32
- res = Https.new(url_base).post_without_params("method",body,header)
33
-
34
- ## About Response
35
- https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html
36
-
37
- # Headers
38
- res['Set-Cookie'] # => String
39
- res.get_fields('set-cookie') # => Array
40
- res.to_hash['set-cookie'] # => Array
41
- puts "Headers: #{res.to_hash.inspect}"
42
-
43
- # Status
44
- puts res.code # => '200'
45
- puts res.message # => 'OK'
46
- puts res.class.name # => 'HTTPOK'
47
-
48
- # Body
49
- puts res.body if res.response_body_permitted?
50
- render json: response.read_body if response.code == 200
51
-
52
- ## Development
53
-
24
+ Gem to make http and https request
25
+
26
+ ##http:
27
+ * Http.new("url_base").get("method")
28
+ * Http.new("url_base").get("method",header)
29
+ * how to use:
30
+ - header = {"Content-Type":"application/json","cache-control":"no-cache"}
31
+ - res = Http.new("url_base").get("method",header)
32
+ * below shows how get body and header of http response
33
+
34
+ ##https:
35
+ * Https.new(url_base).get("method")
36
+ * Https.new(url_base).get("method",header)
37
+ * Https.new(url_base).post("method",header,body)
38
+ * how to use:
39
+ - header = {"Content-Type":"application/json","cache-control":"no-cache"}
40
+ - body = {"email":"nome@email.com","password":"pass121"}
41
+ - res = Http.new("url_base").get("method",header)
42
+
43
+ ## http response
44
+ - Net::HTTP
45
+ * documentation
46
+ - https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html
47
+
48
+ # How get Headers
49
+ - res['Set-Cookie'] # => String
50
+ - res.get_fields('set-cookie') # => Array
51
+ - res.to_hash['set-cookie'] # => Array
52
+ - puts "Headers: #{res.to_hash.inspect}"
53
+
54
+ # How get Status
55
+ - puts res.code # => '200'
56
+ - puts res.message # => 'OK'
57
+ - puts res.class.name # => 'HTTPOK'
58
+
59
+ # How get Body
60
+ - puts res.body if res.response_body_permitted?
54
61
 
55
62
  ## Contributing
56
63
 
57
- Bug reports and pull requests are welcome on GitHub at https://gitlab.com/vini.freire.oliveira/http_client. This project is intended to be a safe,welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
64
+ Bug reports and pull requests are welcome on GitHub at https://gitlab.com/vini.freire.oliveira/l6_http. This project is intended to be a safe,welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
58
65
 
59
66
  ## License
60
67
 
data/l6_http-0.1.0.gem ADDED
Binary file
@@ -1,3 +1,3 @@
1
1
  module HttpClient
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: l6_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinicius Freire
@@ -71,6 +71,7 @@ files:
71
71
  - bin/console
72
72
  - bin/setup
73
73
  - http_client.gemspec
74
+ - l6_http-0.1.0.gem
74
75
  - lib/http_client.rb
75
76
  - lib/http_client/version.rb
76
77
  homepage: https://gitlab.com/vini.freire.oliveira/http_client