-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARRAY: Api request returned invalid json (Airborne::InvalidJsonError) #129
Comments
up |
Rest Client does not accept json body with array ?? |
up |
2 similar comments
up |
up |
I believe the culprit could be airborne/rest_client_requester.rb#L10: module Airborne
module RestClientRequester
def make_request(method, url, options = {})
headers = base_headers.merge(options[:headers] || {})
res = if method == :post || method == :patch || method == :put
begin
request_body = options[:body].nil? ? '' : options[:body]
request_body = request_body.to_json if options[:body].is_a?(Hash)
RestClient.send(method, get_url(url), request_body, headers)
... |
rdalverny
pushed a commit
to rdalverny/airborne
that referenced
this issue
Aug 4, 2017
Until now, the request body is only serialized if it's a Hash. But it could be an Array, or any other serializable type, and those bodies are serialized. See brooklynDev#129, probably brooklynDev#141 as well. I am not sure if this wouldn't break use cases where the body is already expected to be serialized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am sending a request inside an array, but an error 500 occurs with the message: Error: Api request returned invalid json (Airborne::InvalidJsonError)
This problem does not happen when I use Httparty. :(
The text was updated successfully, but these errors were encountered: