Skip to content

Instantly share code, notes, and snippets.

@ceme
Created January 14, 2018 22:54
Show Gist options
  • Save ceme/8be06f4cc898c96b387a1f6e44772b9a to your computer and use it in GitHub Desktop.
Save ceme/8be06f4cc898c96b387a1f6e44772b9a to your computer and use it in GitHub Desktop.
curl commands for rest api
GET
curl \
--header "Accept: application/json" \
https://example.com/api/users
POST
curl \
--header "Content-Type:application/json" \
--header "Accept: application/json" \
--request POST \
--data '{"name":"Brad"}' \
https://example.com/api/user
PUT
curl \
--header "Content-Type:application/json" \
--header "Accept: application/json" \
--request PUT \
--data '{"name:"ryan","uid":"1"}' \
https://example.com/api/user
PATCH
curl \
--header "Content-Type:application/json" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment