"Curl"의 두 판 사이의 차이

wwiki
이동: 둘러보기, 검색
11번째 줄: 11번째 줄:
  
 
-T, --upload-file <file> Transfer local FILE to destination
 
-T, --upload-file <file> Transfer local FILE to destination
 +
 +
== 예시 ==
 +
 +
=== Post ===
 +
 +
==== json ====
 +
$ curl --data '{"key":"value", "key2":"value2"}' --header "Content-Type: application/json" --request POST <nowiki>http://localhost/api</nowiki>
 
[[분류:명령어]]
 
[[분류:명령어]]

2022년 1월 29일 (토) 11:11 판

옵션

-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

예시

Post

json

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