dialogflow-ruby-client
dialogflow-ruby-client copied to clipboard
HTTP::Error Unknown MIME type: text/html
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.
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
I just started getting this error from dialogflow, quite concerning as this is breaking our chatbot and all conversations
Just got this error as well.
Same here, we keep getting this error every once in a while.