CURL은 Client URL(Uniform Resource Locator)이며, 다양한 프로토콜위에서의 데이터 전송을 위해 필요한 라이브러리와 커맨드를 제공하는 소프트웨어라고 말할 수 있다.
클라이언트에서 커맨드 라인이나 소스코드로 손 쉽게 웹 브라우저 처럼 활동할 수 있도록 해주는 기술(커맨드라인 Tool 혹은 라이브러리)
# curl post example
$ curl -d '{"empNo":"E12","empName":"New Employee","position":"Clerk"}' -H "Content-Type: application/json" -X POST http://192.168.0.43:8080/employee
refer: https://gist.github.com/subfuzion/08c5d85437d5d4f00e58
# curl put example
$ curl -X PUT -H "Content-Type: application/json" -d '{"empNo":"E12","empName":"New Employee","position":"test"}' http://192.168.0.43:8080/employee
refer: https://stackoverflow.com/questions/13782198/how-to-do-a-put-request-with-curl
# curl delete example
$ curl -X DELETE http://192.168.0.43:8080/employee/E12
refer: https://www.garron.me/en/bits/curl-delete-request.html
# curl json pretty print
$ curl http://localhost:11608/api/v1.0/containers | python -m json.tool
$ curl http://localhost:11608/api/v1.0/containers | jq ''
※ 참고 사이트 ※
https://stackoverflow.com/questions/12943819/how-to-prettyprint-a-json-file
'리눅스 > 명령어' 카테고리의 다른 글
nohup 명령어 사용 방법 정리 (0) | 2018.11.20 |
---|---|
프로세스별 메모리 사용량 (ps, top) (0) | 2018.05.30 |
메모리 사용량 확인 (free, top, sar, vmstat, dstat) (0) | 2018.05.30 |
fping, nmap: IP 스캔 (0) | 2017.12.23 |
man 페이지 정보를 txt, html, pdf 파일로 저장하는 방법 (0) | 2017.12.21 |