Verify CORS settings using curl

The https://www.example.com has to be the actual host name of the website

The http://localhost:8080/my-api should be the API URL that serves the data

The value of Access-Control-Request-Method can be GET or PUT or POST or DELETE based on the http methods supported by the API URL


curl -I -X OPTIONS -H "Origin: https://www.example.com" -H 'Access-Control-Request-Method: GET' "http://localhost:8080/my-api" 2>&1 | grep -i 'Access-Control-Allow-Origin'

Comments

Popular posts from this blog

JSON with curl and jq

Import self signed in Linux for Chrome / Chromium headless testing

Colima - Drop In replacement for Docker Desktop for Mac and Linux