Skip to content

Instantly share code, notes, and snippets.

@serhiiminin
Last active February 5, 2019 14:43
Show Gist options
  • Save serhiiminin/b08442085bff669c061833cf051395b9 to your computer and use it in GitHub Desktop.
Save serhiiminin/b08442085bff669c061833cf051395b9 to your computer and use it in GitHub Desktop.

cURL

Without params
curl https://jsonplaceholder.typicode.com/todos - GET

  • -X - method
    curl -X POST https://jsonplaceholder.typicode.com/todos
  • -H - additional header
    curl -H "Accept: application/json" https://jsonplaceholder.typicode.com/todos
  • -d - pass data
    curl -X POST -d "{ id: '1' }" https://jsonplaceholder.typicode.com/todos
  • -I - information (get more detailed headers of the request)
    curl -I https://jsonplaceholder.typicode.com/todos
  • -H - additional header
    curl -H "Accept: application/json" https://jsonplaceholder.typicode.com/todos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment