src/Aspose/Storage/Api/StorageApi.php
public function putCreateWithHttpInfo(Requests\PutCreateRequest $request)
    {
        $returnType = '\Aspose\Storage\Model\UploadResponse';
        $request = $this->PutCreateRequest($request);

        try {
            $options = $this->_createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null);
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                if ($statusCode === 401) {
                    $this->_refreshToken();
                    throw new RepeatRequestException("Request must be retried", $statusCode, $response->getHeaders(), $response->getBody());
                }

                throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody());
            }

            $responseBody = $response->getBody();
            if ($returnType === '\SplFileObject') {
                $content = $responseBody; //stream goes to serializer
            } else {
                $content = $responseBody->getContents();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            if ($this->config->getDebug()) {
                $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\Storage\Model\UploadResponse', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 401:
                    $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }
public function putCreateWithHttpInfo(Requests\PutCreateRequest $request)
    {
        $returnType = '\Aspose\Storage\Model\UploadResponse';
        $request = $this->PutCreateRequest($request);

        try {
            $options = $this->_createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null);
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                if ($statusCode === 401) {
                    $this->_refreshToken();
                    throw new RepeatRequestException("Request must be retried", $statusCode, $response->getHeaders(), $response->getBody());
                }

                throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $request->getUri()), $statusCode, $response->getHeaders(), $response->getBody());
            }

            $responseBody = $response->getBody();
            if ($returnType === '\SplFileObject') {
                $content = $responseBody; //stream goes to serializer
            } else {
                $content = $responseBody->getContents();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            if ($this->config->getDebug()) {
                $this->_writeResponseLog($statusCode, $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Aspose\Storage\Model\UploadResponse', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 401:
                    $data = ObjectSerializer::deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }
public function putCreateWithHttpInfo ( Requests \ PutCreateRequest $ request ) { $ returnType = '\Aspose\Storage\Model\UploadResponse' ; $ request = $ this -> PutCreateRequest ( $ request ) ; try { $ options = $ this -> _createHttpClientOption ( ) ; try { $ response = $ this -> client -> send ( $ request , $ options ) ; } catch ( RequestException $ e ) { throw new ApiException ( "[{$e->getCode()}] {$e->getMessage()}" , $ e -> getCode ( ) , $ e -> getResponse ( ) ? $ e -> getResponse ( ) -> getHeaders ( ) : null ) ; } $ statusCode = $ response -> getStatusCode ( ) ; if ( $ statusCode < 200 || $ statusCode > 299 ) { if ( $ statusCode === 401 ) { $ this -> _refreshToken ( ) ; throw new RepeatRequestException ( "Request must be retried" , $ statusCode , $ response -> getHeaders ( ) , $ response -> getBody ( ) ) ; } throw new ApiException ( sprintf ( '[%d] Error connecting to the API (%s)' , $ statusCode , $ request -> getUri ( ) ) , $ statusCode , $ response -> getHeaders ( ) , $ response -> getBody ( ) ) ; } $ responseBody = $ response -> getBody ( ) ; if ( $ returnType === '\SplFileObject' ) { $ content = $ responseBody ; //stream goes to serializer } else { $ content = $ responseBody -> getContents ( ) ; if ( $ returnType !== 'string' ) { $ content = json_decode ( $ content ) ; } } if ( $ this -> config -> getDebug ( ) ) { $ this -> _writeResponseLog ( $ statusCode , $ response -> getHeaders ( ) , ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) ) ; } return [ ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; } catch ( ApiException $ e ) { switch ( $ e -> getCode ( ) ) { case 200 : $ data = ObjectSerializer :: deserialize ( $ e -> getResponseBody ( ) , '\Aspose\Storage\Model\UploadResponse' , $ e -> getResponseHeaders ( ) ) ; $ e -> setResponseObject ( $ data ) ; break ; case 401 : $ data = ObjectSerializer :: deserialize ( $ e -> getResponseBody ( ) , '\SplFileObject' , $ e -> getResponseHeaders ( ) ) ; $ e -> setResponseObject ( $ data ) ; break ; } throw $ e ; } }
/*
Operation putCreateWithHttpInfo

Upload a specific file

@param Requests\PutCreateRequest $request is a request object for operation

@throws \Aspose\Storage\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \Aspose\Storage\Model\UploadResponse, HTTP status code, HTTP response headers (array of strings)
/ * Operation putCreateWithHttpInfo