Commit e44ead4e by 杨树贤

加上请求头

parent 03f9e747
Showing with 6 additions and 0 deletions
...@@ -29,6 +29,12 @@ function curl($url, $params = false, $isPost = 0, $https = 0, $cookie = '', $tim ...@@ -29,6 +29,12 @@ function curl($url, $params = false, $isPost = 0, $https = 0, $cookie = '', $tim
CURLOPT_USERAGENT, CURLOPT_USERAGENT,
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36' 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36'
); );
$headers = [
"From-System"=>"supplier",
"User-Agent"=>"supplier"
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment