Skip to content

Commit

Permalink
Checks for HTTParty::Response#ok? instead of 200
Browse files Browse the repository at this point in the history
POST requests return a 201 response code.
  • Loading branch information
kruppel committed Apr 6, 2018
1 parent bb0855f commit 69daed1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/greenhouse_io/api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def post_to_harvest_api(url, body, headers)

set_headers_info(response.headers)

if response.code == 200
if response.ok?
parse_json(response)
else
raise GreenhouseIo::Error.new(response.code)
Expand Down

0 comments on commit 69daed1

Please sign in to comment.