How do I do HTTP basic authentication using Guzzle?

前端 未结 8 1403
无人及你
无人及你 2020-12-24 00:11

I want to do basic access authentication using Guzzle and I am very new to programming. I have no clue what to do. I tried to do this using curl but my environment requires

8条回答
  •  别那么骄傲
    2020-12-24 01:08

    $response = $client->request( 'GET', 'your_url', [
                        'auth'    => [
                            'your_username',
                            'your_password'
                        ],
                        'headers' => [
                            'if you want to pass something in the headers'
                        ]
                    ]
                );
    

提交回复
热议问题