更新时间:2022-11-27 18:14:44
尝试在正文中以 body
或 json
形式发送用户名和密码,而不是 >application/x-www-form-urlencoded
,像这样:
Try sending username and password inside of a body as body
or json
, instead of as application/x-www-form-urlencoded
, like so:
$res = $client->post('http://stage.example.co.uk/partnerhubwebservice.asmx/Authorise', [
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
],
'json' => [
'username' => 'MMM_bookings',
'password' => 'passwordaaaa',
]
]);
或
$res = $client->post('http://stage.example.co.uk/partnerhubwebservice.asmx/Authorise', [
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
],
'body' => [
'username' => 'MMM_bookings',
'password' => 'passwordaaaa',
]
]);