반응형

curl 3

[Linux] curl 주요 옵션

주요 options (http/https 관련 옵션만 정리) -k --insecure https 사이트를 SSL certificate 검증없이 연결한다. wget 의 --no-check-certificate 과 비슷한 역할 수행 -l --head HTTP header 만 보여주고 content 는 표시하지 않는다 -D --dump-header 에 HTTP header 를 기록한다. -L --location 서버에서 HTTP 301이나 HTTP 302 응답이 왔을 경우 redirection URL 로 따라간다. --max-redirs 뒤에 숫자로 redirection 을 몇 번 따라갈지 지정할 수 있다. 기본 값은 50이다 curl -v daum.net 을 실행하면 결과값으로 다음과 같이 HTTP 302 ..

OS/Linux 2022.03.11

[curl] timeout 설정

[curl] timeout 설정 curl 커맨드는 Response가 돌아올 때 까지 기다리는데, DEFAULT_CONNECT_TIMEOUT 은 5분으로 설정 행 발생으로 인한 서버 비정상 상황 대비해 connect-timeout 시간을 --max-time 옵션으로 직접 요쳥 STATUS=$(curl --max-time 10 -s -o /dev/null -w "%{http_code}" -X POST $CHANGE_REST_API ) if [ $STATUS -eq 200 ]; then log "change call" fi ※ (connect-timeout 옵션은 작동을 안해서 --max-time 으로 설정) - 나중에 미작동 이유 확인 필요

OS/Linux 2022.03.08

[Linux] curl 버전 업그레이드

curl yum 최신버전설치 centos에서 yum설치로 curl을 설치하면 5.19이 기본버전이다 이럴때는 소스설치로 상위버전을 설치하면되지만 yum으로 설치를 원할때는 해당 저장소를 지정한뒤 설치하면됩니다. #vim /etc/yum.repos.d/city-fan.repo [CityFan] name=City Fan Repo baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/ enabled=1 gpgcheck=0 :wq 위저장소추가후 yum install curl 하면 최신버전으로설치 curl 버전 확인 # curl -V ​​ curl 업데이트 파일 다운로드 - 원하는 버전 확인 후 wget 명령을 통해 파일 다운..

OS/Linux 2021.12.24
반응형