linux

curl 이용하기

무세1 2015. 9. 3. 18:49

POST 방식으로 json 날리기

curl http://localhost:8080/api/customers -v -X POST -H "Content-Type: application/json" -d "{\"firstName\":\"kildong\",\"lastName\":\"hong\"}"


curl http://localhost:8080/api/customers -v -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "firstName=kildong&lastName=hong"



GET 방식으로 json 받아오기

curl http://;localhost:8080/api/customers -v -X GET