dialogflow-ruby-client icon indicating copy to clipboard operation
dialogflow-ruby-client copied to clipboard

HTTP::Error Unknown MIME type: text/html

Open tak1n opened this issue 7 years ago • 4 comments

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.

tak1n avatar Jun 21 '17 21:06 tak1n

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

saieswar avatar Sep 18 '17 01:09 saieswar

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

echan00 avatar Oct 17 '17 17:10 echan00

Just got this error as well.

imthatcarlos avatar Oct 17 '17 17:10 imthatcarlos

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

gurschitz avatar Nov 04 '17 21:11 gurschitz