-
Notifications
You must be signed in to change notification settings - Fork 0
Tool Curl
Rajendra Prasad Reddy Penumalli edited this page Dec 12, 2019
·
5 revisions
-
Scripting : bash or shell scripting
-
-c : cookie
-
-A : User Agant
-
-X : HTTP MEthod(GET/POST/PUT/DELETE)
-
-H : header
-
-d : data
-
-s : silent
-
-v : verbose
-
-o : output
-
curl -X GET -H "Content-Type: application/json" "http://localhost:3000/employees"
-
curl -X POST -H "Content-Type: application/json" -d '{"name": "Lisa","salary": "2000"}' "http://localhost:3000/employees"
-
curl -X PUT -H "Content-Type: application/json" -d '{"name": "Lisa", "salary": "8000"}' "http://localhost:3000/employees/3"
-
curl -X DELETE -H "Content-Type: application/json" "http://localhost:3000/employees/2"
-
curl -c cookies.txt www.example.com
Note: in abobe cookies will be saved into cookies.txt file