我有一个API,我正在使用各种方法。 GET和我正在测试的其他人一样工作得很好。使用PATCH
时,尽管文档显示已启用,但仍会出错。
错误是:
Warning: file_get_contents(): SSL: Connection reset by peer in upload.php on line 20
Warning: file_get_contents(https://api-domain/answers/331): failed to open stream: HTTP request failed! in oracle_upload.php on line 20
Error
第20行
$response = file_get_contents('https://api-domain/answers/331', FALSE, $content)
至于$ content变量:
$postData = array(
'solution' => 'Testing 123'
);
$context = stream_context_create(array(
'http' => array(
'method' => 'PATCH',
'header' => "Authorization: Basic dXNlcjpwYXNz\r\nContent-Type: application/json\r\n",
'content' => json_encode($postData)
),
"ssl"=>array(
"allow_self_signed"=>true,
"verify_peer"=>false,
"verify_peer_name"=>false
)
));
请注意,https://api-domain是假的 感谢
答案 0 :(得分:0)
在php.ini文件中更改此行或添加。
(n*n) * (n*n - 1) - n*(n-1)*(n-2)*(3*n-1)/3
extension=php_openssl.dll