Skip to content

Instantly share code, notes, and snippets.

@sharjeelaziz
Last active March 17, 2023 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharjeelaziz/485a8c63490462c35415c8975f0298c2 to your computer and use it in GitHub Desktop.
Save sharjeelaziz/485a8c63490462c35415c8975f0298c2 to your computer and use it in GitHub Desktop.
cURL notes

Without modifying system files, pin a request to an IP address:

curl http://www.example.com --resolve www.example.com:80:127.0.0.1 --resolve www.example.com:443:127.0.0.1

Trace and restrict a request to ipv4 or ipv6:

curl -I --ipv6 --trace-ascii - https://example.com

Test CORS

curl -I -X OPTIONS \                    
  -H "Origin: https://example.com" \
  -H 'Access-Control-Request-Method: GET' \
  "https://test.example.com/themes/us_flag_small.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment