headers['Origin'] = $options['origin']; unset($options['origin']); } parent::__construct($requestWrapper, $data, $uri, $options); } /** * Creates the resume URI. * * @return string */ protected function createResumeUri() { $headers = $this->headers + ['Content-Type' => $this->contentType, 'Content-Length' => 0, 'x-goog-resumable' => 'start']; $request = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('POST', $this->uri, $headers); $response = $this->requestWrapper->send($request, $this->requestOptions); return $this->resumeUri = $response->getHeaderLine('Location'); } /** * Decode the response body * * @param ReponseInterface $response * @return string */ protected function decodeResponse(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response) { return $response->getBody(); } }