src/Google/AdsApi/AdWords/BatchJobs/BatchJobUploadStatus.php
private function initiateResumableUpload($uploadUrl)
    {
        $requestOptions = [];
        $requestOptions[RequestOptions::HEADERS] = [
            'Content-Type' => 'application/xml',
            'Content-Length' => 0,
            'x-goog-resumable' => 'start'
        ];
        if (!empty($this->connectionSettings->getProxyUrl())) {
            $requestOptions[RequestOptions::PROXY] = [
                'https' => $this->connectionSettings->getProxyUrl()
            ];
        }
        // This follows the Google Cloud Storage guidelines for initiating
        // resumable uploads:
        // https://cloud.google.com/storage/docs/resumable-uploads-xml
        $response =
            $this->httpClient->request('POST', $uploadUrl, $requestOptions);

        return $response->getHeader('Location')[0];
    }
private function initiateResumableUpload($uploadUrl)
    {
        $requestOptions = [];
        $requestOptions[RequestOptions::HEADERS] = [
            'Content-Type' => 'application/xml',
            'Content-Length' => 0,
            'x-goog-resumable' => 'start'
        ];
        if (!empty($this->connectionSettings->getProxyUrl())) {
            $requestOptions[RequestOptions::PROXY] = [
                'https' => $this->connectionSettings->getProxyUrl()
            ];
        }
        // This follows the Google Cloud Storage guidelines for initiating
        // resumable uploads:
        // https://cloud.google.com/storage/docs/resumable-uploads-xml
        $response =
            $this->httpClient->request('POST', $uploadUrl, $requestOptions);

        return $response->getHeader('Location')[0];
    }
private function initiateResumableUpload ( $ uploadUrl ) { $ requestOptions = [ ] ; $ requestOptions [ RequestOptions :: HEADERS ] = [ 'Content-Type' => 'application/xml' , 'Content-Length' => 0 , 'x-goog-resumable' => 'start' ] ; if ( ! empty ( $ this -> connectionSettings -> getProxyUrl ( ) ) ) { $ requestOptions [ RequestOptions :: PROXY ] = [ 'https' => $ this -> connectionSettings -> getProxyUrl ( ) ] ; } // This follows the Google Cloud Storage guidelines for initiating // resumable uploads: // https://cloud.google.com/storage/docs/resumable-uploads-xml $ response = $ this -> httpClient -> request ( 'POST' , $ uploadUrl , $ requestOptions ) ; return $ response -> getHeader ( 'Location' ) [ 0 ] ; }
Initiates the resumable upload by sending a request to Google Cloud
Storage.

@param string $uploadUrl the upload URL of a batch job
@return string the URL for the initiated resumable upload
Initiates the resumable upload by sending a request to Google Cloud Storage .