ViewertViewert

cURL

By kerxon · · 1 min read

-X

short for

--request

specifies custom request method for interacting with http server

-H

short for

--header

-d

short for

--data

-b

short for

--cookie

example post request:

curl -X POST -H "Content-Type: application/json" -d '{ "name": "James Bond", "id":"007"}' http://localhost:8080/user

example put request:

curl -X PUT http://localhost:8080/resource/1

-d '{ "resource":"updated data"}'

-H "Content-Type: application/json"

-b "cookie_name=encoded_string"

example delete:

curl -X DELETE -H "Content-Type: application/json" http://localhost:8080/user/007