사용자 도구

사이트 도구


linux:curl

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
linux:curl [2018/09/12 18:09]
kwon37xi
linux:curl [2018/11/06 11:22]
kwon37xi
줄 30: 줄 30:
   * shell script 등에서 curl 요청의 응답이 ''200'' 이 아닌 경우 shell script를 실패하게 하려면 ''-s -w "%{http_code}"''를 사용한다.   * shell script 등에서 curl 요청의 응답이 ''200'' 이 아닌 경우 shell script를 실패하게 하려면 ''-s -w "%{http_code}"''를 사용한다.
 <code sh> <code sh>
-response=(curl -s -w "%{http_code}" -o /path/to/download.zip http://url.to/target.zip)+response=$(curl -s -w "%{http_code}" -o /path/to/download.zip http://url.to/target.zip)
 if [ "$response" != "200" ] if [ "$response" != "200" ]
 then then
linux/curl.txt · 마지막으로 수정됨: 2022/06/15 15:44 저자 kwon37xi