curl: 2개의 글
curl 명령어 응답시간 확인하기
HTTP 응답 속도를 간단하게 확인해보고 싶을 때가 있다. curl 명령어를 아래와 같이 이용하면 별도의 클라이언트를 이용하지 않고 응답시간을 체크할 수 있다. curl -o /dev/null -s -w %{time_total}\\n https://xzio.tistory.com
OS/Linux
2022. 1. 10. 12:54
[PHP][TIP] http 302 (redirect) 일 때 curl 사용하기
curl로 html 소스 코드를 가져오려고 하는데 http 302(redirect) 문제로 redirect된 페이지의 소스코드를 가져올 때 다음과 같이 하면 된다. $url = "YOUR URL"; $res = array(); $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // do not return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_USERAGENT => "spider", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect C..
PHP/php
2021. 1. 6. 16:53