|
|
@@ -16,7 +16,7 @@ class HttpClient
|
|
|
public static function post(string $url, array $data = [], array $headers = [], int $retry = 1)
|
|
|
{
|
|
|
$client = new Client([
|
|
|
- 'timeout' => 8.0,
|
|
|
+ 'timeout' => 10.0,
|
|
|
'verify' => false, // 禁用 SSL 证书验证(测试环境可用)
|
|
|
]);
|
|
|
|
|
|
@@ -24,7 +24,7 @@ class HttpClient
|
|
|
// 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8',
|
|
|
// ], $headers);
|
|
|
$headers = array_merge([
|
|
|
- 'Content-Type' => 'application/json',
|
|
|
+ 'Content-Type' => 'application/json;charset=utf-8',
|
|
|
], $headers);
|
|
|
|
|
|
// 根据 Content-Type 决定请求体格式
|
|
|
@@ -173,8 +173,11 @@ class HttpClient
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ //$headers = array_merge([
|
|
|
+ //'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8',
|
|
|
+ //], $headers);
|
|
|
$headers = array_merge([
|
|
|
- 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8',
|
|
|
+ 'Content-Type' => 'application/json;charset=utf-8',
|
|
|
], $headers);
|
|
|
|
|
|
// 根据 Content-Type 决定请求体格式
|