CORS tester
Send a cross-origin request and see which CORS headers come back.
CORS Request Tester
curl command
curl -i -X GET "https://api.github.com" -H "Origin: "Response
Send a request to test CORS
Requests are sent from this page, so the result shows whether that origin is allowed
How to use
- Enter any API endpoint URL you want to test.
- Select the HTTP method (GET, POST, PUT, DELETE, OPTIONS).
- Click “Test CORS” to make a cross-origin request.
- View the CORS headers and response data.
- See whether the server has CORS configured properly.
Common CORS headers
- Access-Control-Allow-Origin
- Which origins can access the resource
- Access-Control-Allow-Methods
- Allowed HTTP methods
- Access-Control-Allow-Headers
- Allowed request headers
- Access-Control-Allow-Credentials
- Whether credentials are allowed
About the CORS tester
Send a request from your browser to any URL and see whether the browser lets this page read the response. Use it to check whether an API can be called from front-end JavaScript on another origin before you write the code, or to debug a blocked request.
How to use it
- Choose a method: GET, POST, PUT, DELETE or OPTIONS.
- Enter the endpoint URL and select Test CORS.
- Read the status and body, any CORS headers the browser exposes, or the error.
- To see every response header, including ones the browser hides, run the curl command shown with -i added.
How the request is sent
Your browser sends the request directly to the target with fetch in cors mode, from the origin https://ctmakes.com; it does not go through this site's server. It sends no body, custom headers or cookies; PUT, DELETE and OPTIONS trigger a preflight.
Reading the results
A response means the server allowed this origin. Browsers hide Access-Control-* headers from scripts unless the server lists them in Access-Control-Expose-Headers, so a missing CORS headers panel does not mean CORS is off. A blocked request looks the same to JavaScript as a network failure; your browser console gives the reason.
What it cannot tell you
It covers only this origin and a plain request. Requests with Authorization or JSON Content-Type headers, or credentials, may get a different answer.
Questions
- What is CORS?
- Cross-Origin Resource Sharing lets a server tell browsers which other origins may read its responses, using headers such as Access-Control-Allow-Origin.
- Why does a request work in curl but fail in the browser?
- Only browsers enforce CORS. curl and server-side code ignore it, so a request can succeed there and still be blocked in a page.
- What is a preflight request?
- For a cross-origin request using a method other than GET, HEAD or POST, or headers such as Authorization, the browser first sends an OPTIONS request. If the server's Access-Control-Allow-Methods and Access-Control-Allow-Headers do not match, the real request is never sent.