Curl

wwiki
Jhkim (토론 | 기여)님의 2023년 3월 28일 (화) 10:03 판 (옵션)
이동: 둘러보기, 검색

옵션

-H, --header <header/@file> Pass custom header(s) to server. (ex: -H 'X-Naver-Client-Id: xxxx')

-v, --verbose Make the operation more talkative

-k, --insecure Allow insecure server connections when using SSL

-u, --user <user:password> Server user and password

--digest Use HTTP Digest Authentication

-T, --upload-file <file> Transfer local FILE to destination

-s, --silent Silent mode (에러 메시지 등이 보이지 않지만, output은 보이기 때문에 > /dev/null 출력을 전환해야 한다.)

-X, --request <method> Specify request method to use

예시

Post

json

$ curl --data '{"key":"value", "key2":"value2"}' --header "Content-Type: application/json" --request POST http://localhost/api