A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ruby-grape/grape/issues/1515 below:

error! method returns wrong content type "text/html" for 404 status code · Issue #1515 · ruby-grape/grape · GitHub

When I do:

error!({message: 'no data'}, 404) or even simple one error!({}, 404)

I always get text/html for content-type with the response:

"<!DOCTYPE html>\n<html>\n<head>\n <style type=\"text/css\">\n body { text-align:center;font-family:helvetica,arial;font-size:22px;\n color:#888;margin:20px}\n #c {margin:0 auto;width:500px;text-align:left}\n </style>\n</head>\n<body>\n <h2>Sinatra doesn&rsquo;t know this ditty.</h2>\n <img src='http://localhost:7777/__sinatra__/404.png'>\n <div id=\"c\">\n Try this:\n <pre>get '/api/customers/111/info' do\n \"Hello World\"\nend\n</pre>\n </div>\n</body>\n</html>\n"

However, if I change to any other status code like error!({}, 500), it returns the expected JSON response.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4