CORS Tester
Test any Uniform Resource Locator (URL) for Cross-Origin Resource Sharing (CORS) with a custom method, headers, and body — see exactly why a browser would allow or block the request.
A preflight exchange, step by step
A page on https://app.example.com sends a PUT request with a JSON body to
https://api.example.net. Because the origins differ and the request is not a simple
one, the browser first asks for permission with an OPTIONS request:
OPTIONS /v1/profile HTTP/1.1
Origin: https://app.example.com
Access-Control-Request-Method: PUT
Access-Control-Request-Headers: content-type, authorization
The server permits it with:
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: https://app.example.com
Access-Control-Allow-Methods: GET, PUT, DELETE
Access-Control-Allow-Headers: content-type, authorization
Access-Control-Max-Age: 600
Vary: Origin
Only then does the browser send the PUT request itself. The answer to that request must carry
Access-Control-Allow-Origin again, otherwise the browser withholds the response from
the page.
Rules that are easy to get wrong
- The origin must match exactly. Scheme, host and port all count:
https://app.example.comandhttps://app.example.com:8443are different origins, and a trailing slash in the header value never matches. - One origin per response. The header takes a single origin or
*, not a list. A server that serves several origins must echo the request's origin after checking it against its own list, and sendVary: Originso caches keep the answers apart. - The wildcard excludes credentials. With cookies or an
Authorizationheader,Access-Control-Allow-Origin: *is refused; the exact origin andAccess-Control-Allow-Credentials: trueare required. - The preflight carries no credentials. A server that answers OPTIONS with 401 fails every preflight. OPTIONS must be answered without authentication.
- Error responses need the headers too. When a 500 answer lacks the CORS headers, the browser reports a CORS error and hides the real fault.
- CORS protects the user, not the server. It stops a web page from reading a response. It does not stop a script, a command-line client or another server from calling the API.
Related tools
Monitor CORS Tester automatically
Test any Uniform Resource Locator (URL) for Cross-Origin Resource Sharing (CORS) with a custom method, headers, and body — see exactly why a browser would allow or block the request. NetTests can run this check on a schedule, preserve historical results, compare changes over time, and alert you the moment something breaks.
Start monitoring free → See all monitoring productsFrequently Asked Questions
What is this CORS tester tool about?
The Cross-Origin Resource Sharing (CORS) tester is a free tool that checks whether a given Uniform Resource Locator (URL) allows cross-origin requests. Enter the URL you want to test and the origin making the request, choose a method, optionally add headers and a body, then click Run Test. The tool sends the request, reads the server's Access-Control-* response headers, and shows you exactly whether a browser would allow or block it — and why.
What is CORS?
Cross-Origin Resource Sharing (CORS) is a browser mechanism that relaxes the Same-Origin Policy to allow controlled access to resources across different origins. By default browsers block requests between different origins; CORS lets a server opt in by returning headers such as Access-Control-Allow-Origin. For example, if your frontend runs on https://app.example.com and fetches data from https://api.example.com, the browser blocks it unless the Application Programming Interface (API) explicitly allows that origin. CORS is enforced entirely by the browser — tools like Postman or cURL never show CORS errors because they don't enforce the Same-Origin Policy.
How does this CORS tester work?
The tester sends the request you configure (method, headers, body) to the target URL with your chosen Origin, then inspects the server's response headers to determine whether a real browser would permit the response. When the request isn't a simple request, it first sends the OPTIONS preflight just like a browser would, and evaluates whether the preflight grants the method and headers you're using.
What is a CORS preflight request?
A preflight is an automatic OPTIONS request the browser sends before certain cross-origin requests — when you use a method other than GET, HEAD, or POST, or include non-safelisted headers like Authorization, or send a Content-Type other than application/x-www-form-urlencoded, multipart/form-data, or text/plain. The preflight asks the server which methods and headers it allows. If it fails, the browser never sends the actual request.
How do I test CORS with credentials?
Tick Include credentials and set the Origin to your frontend domain. When credentials (cookies or Authorization) are involved, the spec requires the server to return the exact origin (not *) in Access-Control-Allow-Origin and to include Access-Control-Allow-Credentials: true. The tool flags it when either is missing.
Why does my API work in Postman but fail here?
Postman and cURL are backend HyperText Transfer Protocol (HTTP) clients that don't enforce the browser's Same-Origin Policy — they send requests directly without any Cross-Origin Resource Sharing (CORS) checks. This tool evaluates the response the way a browser does, so it reveals CORS blocks that Postman ignores. If your Application Programming Interface (API) works in Postman but fails here, your server is missing the required CORS headers.
What CORS headers does this tool check?
The tool inspects all standard Cross-Origin Resource Sharing (CORS) response headers:
- Access-Control-Allow-Origin — which origin(s) may read the response.
- Access-Control-Allow-Methods — methods allowed for cross-origin requests.
- Access-Control-Allow-Headers — which request headers are permitted.
- Access-Control-Allow-Credentials — whether cookies / auth are allowed.
- Access-Control-Max-Age — how long the preflight result is cached.
- Access-Control-Expose-Headers — response headers JavaScript may read.
How do I fix "No 'Access-Control-Allow-Origin' header is present"?
This is the most common Cross-Origin Resource Sharing (CORS) error — the server didn't return an Access-Control-Allow-Origin header. Configure your server to send it. Examples:
Node.js (Express):
const cors = require('cors');
app.use(cors({ origin: 'https://example.com', credentials: true }));Python (Flask):
from flask_cors import CORS
CORS(app, origins=['https://example.com'], supports_credentials=True)Nginx:
add_header Access-Control-Allow-Origin "https://example.com" always;
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" always;
add_header Access-Control-Allow-Headers "Content-Type, Authorization" always;
if ($request_method = OPTIONS) { return 204; }How do I fix "Method PUT is not allowed by Access-Control-Allow-Methods"?
The preflight succeeded but the server didn't list the method you're using. Add it to your Cross-Origin Resource Sharing (CORS) config, e.g. Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS.
How do I fix "Request header field … is not allowed by Access-Control-Allow-Headers"?
Your request includes a header (often Authorization) the server hasn't explicitly allowed. Add the header name to the server's Access-Control-Allow-Headers response, e.g. Access-Control-Allow-Headers: Content-Type, Authorization.
Can I test a localhost development server?
Yes. Set the Origin to your local frontend Uniform Resource Locator (URL) (e.g. http://localhost:3000 or http://localhost:5173) to simulate how your local app will interact with a remote Application Programming Interface (API). Note the target URL must be reachable from this server.