$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $linkUrl); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_FAILONERROR, false); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘POST‘); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, [‘Content-Type:application/x-www-form-urlencoded‘]); //设置凭证curl_setopt($ch, CURLOPT_USERPWD, ‘user:pwd‘);curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
原文地址:https://www.cnblogs.com/codeninja/p/11969624.html
时间: 2024-11-29 02:22:00