Skip to content
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

HTTP::Error Unknown MIME type: text/html #18

Open
tak1n opened this issue Jun 21, 2017 · 4 comments
Open

HTTP::Error Unknown MIME type: text/html #18

tak1n opened this issue Jun 21, 2017 · 4 comments

Comments

@tak1n
Copy link
Contributor

tak1n commented Jun 21, 2017

When API.ai does not respond with json calling #parse on a HTTP response raises an exception as no other Mime Type handler is registered yet. (HTTP implements json handler as default: https://github.com/httprb/http/blob/master/lib/http/mime_type/json.rb)

This problem mostly occurrs when API.ai is down (so should not be a big deal as I hope it is not that often down :D), but still it would be helpful to have a more intuitive exception raised.
Further down in apiai-ruby-cllient the problem is that fail_or_return_response_body(response.code, response_body) already takes the parsed response as argument.

apiai-ruby-client should probably only call #parse if it knows it's a json response.

Is this anything we should improve? If yes I will try to create a pr for it.

@saieswar
Copy link

saieswar commented Sep 18, 2017

correct, but sometimes if anything wrong in client access token like adding spaces etc this issue is reproduced we can resolve by making it correct

@echan00
Copy link

echan00 commented Oct 17, 2017

I just started getting this error from dialogflow, quite concerning as this is breaking our chatbot and all conversations

@imthatcarlos
Copy link

Just got this error as well.

@gurschitz
Copy link

Same here, we keep getting this error every once in a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants