且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取cUrl以抢先发送PHP进行DIGEST身份验证的Authorization标头

更新时间:2023-12-03 20:39:58

您必须重新使用相同的curl句柄:请参见

You must re-use the same curl handle: see this similar question for more details.

就多接口而言,您还需要显式重用每个句柄以利用摘要访问身份验证请求计数器,即,牢记C API:

As far as the multi interface is concerned you also need to explicitly reuse each handle to leverage the Digest Access Authentication request counter, i.e. with the C API in mind:

  1. 使用curl_multi_remove_handle
  2. 从多手柄中移除手柄
  3. curl_easy_reset
  4. 重置
  5. 设置下一个通话的选项
  6. 使用curl_multi_add_handle
  7. 将其重新添加到多手柄中
  1. remove your handle from the multi handle with curl_multi_remove_handle
  2. reset it with curl_easy_reset
  3. set the options for the next call
  4. re-add it into the multi handle with curl_multi_add_handle