Skip to content

Instantly share code, notes, and snippets.

@jccarbonfive
Created February 27, 2012 04:59
Show Gist options
  • Select an option

  • Save jccarbonfive/1921513 to your computer and use it in GitHub Desktop.

Select an option

Save jccarbonfive/1921513 to your computer and use it in GitHub Desktop.
$ curl \
--verbose \
--request OPTIONS \
http://localhost:3000/users/1.json \
--header 'Origin: http://server1.example.com' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: PUT'
* About to connect() to localhost port 3000 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> OPTIONS /users/1.json HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4
> OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> Origin: http://example.com
> Access-Control-Request-Headers: Origin, Accept, Content-Type
> Access-Control-Request-Method: PUT
>
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Access-Control-Allow-Origin: server1.example.com
< Access-Control-Allow-Methods: PUT, DELETE
< Access-Control-Expose-Headers:
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Origin, Accept, Content-Type
< X-Ua-Compatible: IE=Edge
< Cache-Control: no-cache
< X-Request-Id: 2e2a8873d24856b02943c33673b3faaa
< X-Runtime: 0.001045
< Content-Length: 0
< Server: WEBrick/1.3.1 (Ruby/1.9.3/2011-07-31)
< Date: Sun, 26 Feb 2012 04:56:05 GMT
< Connection: Keep-Alive
<
* Connection #0 to host localhost left intact
* Closing connection #0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment