Skip to content

Instantly share code, notes, and snippets.

@ssledz
Last active December 12, 2021 16:11
Show Gist options
  • Save ssledz/86e029283b79eaaec1f5a3c53b1f3f85 to your computer and use it in GitHub Desktop.
Save ssledz/86e029283b79eaaec1f5a3c53b1f3f85 to your computer and use it in GitHub Desktop.

Check cors origin policy

curl -v -X OPTIONS \
  --header 'Origin: http://some.origin.here' \
  --header 'Access-Control-Request-Method: GET' \
  http://localhost:8085/tokens 

Post

json

curl -X POST -d '{"key1":"value1", "key2":"value2"}' \
  -H "Content-Type: application/json" http://localhost:3000/data
curl -X POST -H "Content-Type: application/json" -d @tx.signed http://localhost:8085/transaction/submit

url-encode

curl -X POST -d "param1=value1&param2=value2" http://localhost:3000/data
curl -X POST -d "param1=value1&param2=value2" \
  -H "Content-Type: application/x-www-form-urlencoded" http://localhost:3000/data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment