-
-
Save cicorias/54f5137fe259c7efdc58b1887b41796f to your computer and use it in GitHub Desktop.
Testing CORS OPTIONS request with curl
This file contains hidden or 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 -H "Origin: http://example.com" \ | |
-H "Access-Control-Request-Method: POST" \ | |
-H "Access-Control-Request-Headers: X-Requested-With" \ | |
-X OPTIONS --verbose \ | |
http://localhost:8545 |
This file contains hidden or 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 \ | |
--verbose \ | |
--request OPTIONS \ | |
http://localhost:3001/api/configuration/visitor \ | |
--header 'Origin: http://localhost:9292' \ | |
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
--header 'Access-Control-Request-Method: GET' | |
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE | |
# http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment