I have a an API I'm using a variety of methods on. GET works fine as do the others I am testing. When using PATCH
, it gives errors despite the documentation showing it's enabled.
The errors are:
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
Line 20 is
$response = file_get_contents('https://api-domain/answers/331', FALSE, $content)
As for the $content variable:
$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
)
));
Please note, https://api-domain is a fake addy Thanks