ruby_http_client 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -2
- data/examples/example.rb +1 -2
- data/lib/ruby_http_client.rb +3 -0
- data/ruby_http_client.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c64bba37084381080a33b1097bac58bdfabb94b
|
4
|
+
data.tar.gz: f45e86df95ac5b53d5f283223cfdfd15802c87b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65197b2e4d2d41b798542de1334902bfa373c1232db2f8ababfd133baa6eb6e4eef804e7187925f258761d05c4f3286bfebf2cc68fd3dd9c4dd06f30ce5b3671
|
7
|
+
data.tar.gz: eaf33a779c92d1c1595ef5f232bbb96b33845283e024f80610282e943efb9437154d60ec107e74a5e0441237439a305d75ca2e4bea507e8f818a069d8b5bdf01
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [2.1.0] - 2016-06-10
|
7
|
+
### Added
|
8
|
+
- Automatically add Content-Type: application/json when there is a request body
|
9
|
+
|
6
10
|
## [2.0.0] - 2016-06-03
|
7
11
|
### Changed
|
8
12
|
- Made the Response variables non-redundant. e.g. response.response_body becomes response.body
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
[![Travis Badge](https://travis-ci.org/sendgrid/ruby-http-client.svg?branch=master)](https://travis-ci.org/sendgrid/ruby-http-client)
|
2
2
|
|
3
|
-
**Quickly and easily access any
|
3
|
+
**Quickly and easily access any RESTful or RESTful-like API.**
|
4
|
+
|
5
|
+
If you are looking for the SendGrid API client library, please see [this repo](https://github.com/sendgrid/sendgrid-ruby).
|
4
6
|
|
5
7
|
# Announcements
|
6
8
|
|
@@ -74,4 +76,4 @@ ruby-http-client is guided and supported by the SendGrid [Developer Experience T
|
|
74
76
|
ruby-http-client is maintained and funded by SendGrid, Inc. The names and logos for ruby-http-client are trademarks of SendGrid, Inc.
|
75
77
|
|
76
78
|
![SendGrid Logo]
|
77
|
-
(https://
|
79
|
+
(https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
|
data/examples/example.rb
CHANGED
@@ -3,8 +3,7 @@ require_relative '../lib/ruby_http_client'
|
|
3
3
|
# This example uses the SendGrid API as an example
|
4
4
|
headers = JSON.parse('
|
5
5
|
{
|
6
|
-
"Authorization": "Bearer ' + ENV['SENDGRID_API_KEY'] + '"
|
7
|
-
"Content-Type": "application/json"
|
6
|
+
"Authorization": "Bearer ' + ENV['SENDGRID_API_KEY'] + '"
|
8
7
|
}
|
9
8
|
')
|
10
9
|
host = 'https://api.sendgrid.com'
|
data/lib/ruby_http_client.rb
CHANGED
@@ -148,6 +148,9 @@ module SendGrid
|
|
148
148
|
request = net_http.new(uri.request_uri)
|
149
149
|
request = build_request_headers(request)
|
150
150
|
request.body = @request_body.to_json if @request_body
|
151
|
+
if request.body
|
152
|
+
request['Content-Type'] = 'application/json'
|
153
|
+
end
|
151
154
|
make_request(http, request)
|
152
155
|
end
|
153
156
|
|
data/ruby_http_client.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'ruby_http_client'
|
7
|
-
spec.version = '2.
|
7
|
+
spec.version = '2.1.0'
|
8
8
|
spec.authors = ['Elmer Thomas']
|
9
9
|
spec.email = 'dx@sendgrid.com'
|
10
10
|
spec.summary = 'A simple REST client'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_http_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elmer Thomas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|