public function put($request)
    {
        $this->logger->debug("PUT ");

        $ch = curl_init();

        // Handle body
        $body = $request->getBody();
        $requestLength = strlen($body);
        $fh = fopen('php://temp', 'rw');

        fwrite($fh, $body);
        rewind($fh);

        $this->setOptions($ch, $request->getUrlStr(), $request->getHeaders());

        // Options specific to PUT
        curl_setopt($ch, CURLOPT_INFILE, $fh);
        curl_setopt($ch, CURLOPT_INFILESIZE, $requestLength);
        curl_setopt($ch, CURLOPT_PUT, true);

        $ret = $this->execute($ch);

        fclose($fh);

        return $ret;
    }
public function put($request)
    {
        $this->logger->debug("PUT ");

        $ch = curl_init();

        // Handle body
        $body = $request->getBody();
        $requestLength = strlen($body);
        $fh = fopen('php://temp', 'rw');

        fwrite($fh, $body);
        rewind($fh);

        $this->setOptions($ch, $request->getUrlStr(), $request->getHeaders());

        // Options specific to PUT
        curl_setopt($ch, CURLOPT_INFILE, $fh);
        curl_setopt($ch, CURLOPT_INFILESIZE, $requestLength);
        curl_setopt($ch, CURLOPT_PUT, true);

        $ret = $this->execute($ch);

        fclose($fh);

        return $ret;
    }
public function put ( $ request ) { $ this -> logger -> debug ( "PUT " ) ; $ ch = curl_init ( ) ; // Handle body $ body = $ request -> getBody ( ) ; $ requestLength = strlen ( $ body ) ; $ fh = fopen ( 'php://temp' , 'rw' ) ; fwrite ( $ fh , $ body ) ; rewind ( $ fh ) ; $ this -> setOptions ( $ ch , $ request -> getUrlStr ( ) , $ request -> getHeaders ( ) ) ; // Options specific to PUT curl_setopt ( $ ch , CURLOPT_INFILE , $ fh ) ; curl_setopt ( $ ch , CURLOPT_INFILESIZE , $ requestLength ) ; curl_setopt ( $ ch , CURLOPT_PUT , true ) ; $ ret = $ this -> execute ( $ ch ) ; fclose ( $ fh ) ; return $ ret ; }
Perform a PUT request with cURL

@param RESTRequest request A REST request.
@return RESTResponse A REST response.
Perform a PUT request with cURL