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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 890828c72f8180fafeff5f0a3b8d6af9e0cdc325
4
- data.tar.gz: e0c13a22556aa5e2b32401db7cca447128a67d73
3
+ metadata.gz: 3c64bba37084381080a33b1097bac58bdfabb94b
4
+ data.tar.gz: f45e86df95ac5b53d5f283223cfdfd15802c87b9
5
5
  SHA512:
6
- metadata.gz: 3d78da08c2efdb0b95177f77c9baae83a6fbca1c5c0f950b7d19ef966f5a81449edd7267f2169119b6ed29bb37517d68f45a5c50326027feecfdd805fce23ebf
7
- data.tar.gz: 47639cffff96c33af158a6e7a0f891bc6b8d97fb522a6e0b16337d732da385d80ede0eabe134c0f216e8c9657da474c30c6e77e253ec44f0be6e903f12379308
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 REST or REST-like API.**
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://assets3.sendgrid.com/mkt/assets/logos_brands/small/sglogo_2015_blue-9c87423c2ff2ff393ebce1ab3bd018a4.png)
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'
@@ -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
 
@@ -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.0.0'
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.0.0
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-03 00:00:00.000000000 Z
11
+ date: 2016-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake