array( 'header' => 'Content-Type: text/json', 'method' => 'POST', 'content' => $postBody, ), ); $context = stream_context_create($options); $result = file_get_contents($requestUrl, false, $context); /*** * Handle HTTP error ***/ if ($result === FALSE) { echo "Something went wrong"; } else { /*** * Print Result ***/ echo "Result:\n"; $jsonResult = json_decode($result, true); print_r($jsonResult); }