Skip to content
Tools

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

  1. Enter any API endpoint URL you want to test.
  2. Select the HTTP method (GET, POST, PUT, DELETE, OPTIONS).
  3. Click “Test CORS” to make a cross-origin request.
  4. View the CORS headers and response data.
  5. 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

  1. Choose a method: GET, POST, PUT, DELETE or OPTIONS.
  2. Enter the endpoint URL and select Test CORS.
  3. Read the status and body, any CORS headers the browser exposes, or the error.
  4. 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.