Created
April 20, 2014 22:48
-
-
Save cfurrow/11127188 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BullshitController < ApplicationController | |
respond_to :json | |
def bullshit | |
bullshit = Bullshit.new | |
if bullshit.save | |
respond_with bullshit, status: :ok | |
else | |
respond_with bullshit, status: :unprocessable_entity | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -I http://localhost:3000/bullshit | |
HTTP/1.1 422 Unprocessable Entity | |
X-Frame-Options: SAMEORIGIN | |
X-Xss-Protection: 1; mode=block | |
X-Content-Type-Options: nosniff | |
X-Ua-Compatible: chrome=1 | |
Content-Type: application/json; charset=utf-8 | |
Cache-Control: no-cache | |
X-Request-Id: 83a3ad25-60b4-4421-ac93-56630803a71a | |
X-Runtime: 0.004175 | |
Server: WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22) | |
Date: Sun, 20 Apr 2014 22:47:58 GMT | |
Content-Length: 0 | |
Connection: Keep-Alive | |
Set-Cookie: request_method=HEAD; path=/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment