lib/apidiesel/handlers/json.rb in apidiesel-0.10 vs lib/apidiesel/handlers/json.rb in apidiesel-0.11
- old
+ new
@@ -15,10 +15,14 @@
payload: payload,
api_config: api_config)
request.metadata[:finished_at] = DateTime.now
- request.response_body = ::JSON.parse(request.http_response.body)
+ if request.http_response.code == 204
+ request.response_body = {}
+ else
+ request.response_body = ::JSON.parse(request.http_response.body)
+ end
request
end
end
end
\ No newline at end of file