주 메뉴 열기

wwiki β

바뀜

Curl

1,776 바이트 추가됨, 2023년 4월 20일 (목) 00:29
편집 요약 없음
== 사용법 ==Usage: curl [options...] <url> === 기본 옵션 ===
-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
 
=== -L, --location ===
(HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place.
 
=== -d, --data <nowiki><data></nowiki> ===
(HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button.
 
If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin.
 
Examples:
 curl -d "name=curl" <nowiki>https://example.com</nowiki>
 curl -d "name=curl" -d "tool=cmdline" <nowiki>https://example.com</nowiki>
 curl -d @filename <nowiki>https://example.com</nowiki>
 
=== --data-binary <nowiki><data></nowiki> ===
(HTTP) This posts data exactly as specified with no extra processing whatsoever.
 
 
Example:
 curl --data-binary @filename <nowiki>https://example.com</nowiki>
 
== 예시 ==
 
=== Post ===
 
==== json ====
$ curl --data '{"key":"value", "key2":"value2"}' --header "Content-Type: application/json" --request POST <nowiki>http://localhost/api</nowiki>
 
== 외부링크 ==
https://curl.se/
 
[[분류:명령어]]
편집
2,431