stream = stream_context_create($options); } /** * The response headers from the stream wrapper * * @return array */ public function getResponseHeaders() { return $this->responseHeaders; } /** * Send a stream wrapped request * * @param string $url * * @return mixed */ public function fileGetContents($url) { // $rawResponse = file get contents($url, false, $this->stream); $rawResponse = wp_remote_get($url, ['stream' => $this->stream]); $this->responseHeaders = $http_response_header ?: []; return $rawResponse; } }