我使用laravel和GuzzleHttp进行与以下相同的发送帖子请求
$client = new Client(['verify' => false]);
$data = [
'headers' => [
'Authorization' => 'code',
'Content-Type' => 'application/x-www-form-urlencoded',
],
'form-params' => [
'redirect_uri' => 'http://localhost',
'code' => 'MZTADnFF6m'
]
];
$response = $client->request('POST', 'https://oom.com', $data);
但是我的问题是'http://localhost'
作为'http:\/\/localhost'
发送到api服务器
我该如何解决这个问题?
使用urlencode这是
'redirect_uri' => urlencode('http://localhost'),