【问题标题】:How I can set auth type to pre emptive with guzzlehttp client如何使用 guzzlehttp 客户端将身份验证类型设置为抢占式
【发布时间】:2018-10-08 15:03:55
【问题描述】:
$response=$client->request("POST",$url,[

    "body"=>$soap,
    "auth"=>["blabla","blabla"]
    'headers' => [
        'Content-Type' => 'text/xml; charset=UTF8',
    ],

]);

我的 php 代码,但我想设置身份验证类型,我该如何设置身份验证类型?

【问题讨论】:

    标签: php authentication guzzle preemptive


    【解决方案1】:

    authentication type 可以作为“auth”数组中的第三项传递,可以是"basic", "digest", "ntlm" 中的任何一个

    "auth" => ["<user>", "<pwd>", "<auth_type>"]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-24
      • 2014-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多