lucasconstantino / php5rp

Automatically exported from code.google.com/p/php5rp
0 stars 0 forks source link

PUT data not forwarded. #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Data associated with an HTTP PUT is not forwarded

Original issue reported on code.google.com by mart...@gmail.com on 5 Nov 2009 at 2:48

GoogleCodeExporter commented 9 years ago
Simple fix is to add

        elseif ($_SERVER['REQUEST_METHOD'] == 'PUT')
            {
                // Set the request method.
                $this->setCurlOption(CURLOPT_UPLOAD, 1);

                // PUT data comes in on the stdin stream.
                $putdata = fopen("php://input", "r");
                $this->setCurlOption(CURLOPT_READDATA, $putdata);
                // TODO: set CURLOPT_INFILESIZE to the value of Content-Length.
            }

Original comment by mart...@gmail.com on 5 Nov 2009 at 3:35