Skip to content

Commit

Permalink
Version Bump v2.2.1: Fix edge case for POST
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious committed Jun 11, 2016
1 parent 4d618ed commit 2004a23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.1] - 2016-06-10
### Fix
- Deal with an edge case where when you send a POST with no body, net/http sets the content type to application/x-www-form-urlencoded

## [2.1.0] - 2016-06-10
### Added
- Automatically add Content-Type: application/json when there is a request body
Expand Down
2 changes: 2 additions & 0 deletions lib/ruby_http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def build_request(name, args)
request.body = @request_body.to_json if @request_body
if request.body
request['Content-Type'] = 'application/json'
elsif !request.body and (name = "post")
request['Content-Type'] = ''
end
make_request(http, request)
end
Expand Down
2 changes: 1 addition & 1 deletion ruby_http_client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'ruby_http_client'
spec.version = '2.1.0'
spec.version = '2.1.1'
spec.authors = ['Elmer Thomas']
spec.email = '[email protected]'
spec.summary = 'A simple REST client'
Expand Down

0 comments on commit 2004a23

Please sign in to comment.