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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +42 -35
- data/l6_http-0.1.0.gem +0 -0
- data/lib/http_client/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c219e160fc1acb88a74ddc7373a3045ef15dbc6aa5462586680ef4901c5b6e48
|
4
|
+
data.tar.gz: 0cbe59a186ff5d0128c62fe794d90303c5c04ade5628c7cb477e1410f52fe531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a0851861232062aa79a20b7d6e53ff6b4187da853e22b5394343ea5b819df25d64e0a6244b98334b496f7f12751291f94e910eec50226cf32c3495455dcbd6
|
7
|
+
data.tar.gz: e77e35ea9c953b78705f3caa86e507ce900f27406a198f440333d80f7a564590291e495ddf04f11dbf5a6dc6a4312fbdadacfa4855d78579757cb2546535735f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# L6_Http
|
2
2
|
|
3
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
res =
|
30
|
-
header
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
res.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
#
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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/
|
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
|
data/lib/http_client/version.rb
CHANGED
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.
|
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
|