|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-09-23 19:28 UTC] mike@php.net
-Assigned To:
+Assigned To: mike
[2014-09-25 07:22 UTC] mike@php.net
[2014-09-25 07:22 UTC] mike@php.net
-Status: Assigned
+Status: Closed
[2014-09-25 07:23 UTC] mike@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
Description: ------------ First PUT request works. But if I send PUT request after DELETE request, the PUT request doesn't work because the request is sent with DELETE method instead of PUT method. Webdav access log: 10.10.120.171 - - [23/Sep/2014:13:15:34 +0200] "PUT /file1.ico HTTP/1.1" 201 0 "-" "PECL_HTTP/2.1.1 PHP/5.5.11 libcurl/7.36.0" 10.10.120.171 - - [23/Sep/2014:13:15:34 +0200] "DELETE /file1.ico HTTP/1.1" 204 0 "-" "PECL_HTTP/2.1.1 PHP/5.5.11 libcurl/7.36.0" 10.10.120.171 - - [23/Sep/2014:13:15:34 +0200] "DELETE /file2.ico HTTP/1.1" 415 194 "-" "PECL_HTTP/2.1.1 PHP/5.5.11 libcurl/7.36.0" Webdav error log: 2014/09/23 13:15:34 [error] 19953#0: *8240 DELETE with body is unsupported, client: 10.10.120.171, server: webdav.local, request: "DELETE /file2.ico HTTP/1.1", host: "webdav.local" Test script: --------------- <?php $host = 'webdav.local'; $file = 'favicon.ico'; $data = file_get_contents($file); $httpClient = new \http\Client(); $httpRequestBody1 = new \http\Message\Body(); $httpRequestBody1->append($data); $httpRequest1 = new \http\Client\Request('PUT', $host . '/file1.ico'); $httpRequest1->setBody($httpRequestBody1); $httpClient->reset(); $httpClient->enqueue($httpRequest1); $httpClient->send(); $httpResponse1 = $httpClient->getResponse(); echo sprintf("%s:%s\n", $httpResponse1->getResponseCode(), $httpResponse1->getResponseStatus()); $httpRequest2 = new \http\Client\Request('DELETE', $host . '/file1.ico'); $httpClient->reset(); $httpClient->enqueue($httpRequest2); $httpClient->send(); $httpResponse2 = $httpClient->getResponse(); echo sprintf("%s:%s\n", $httpResponse2->getResponseCode(), $httpResponse2->getResponseStatus()); $httpRequestBody3 = new \http\Message\Body(); $httpRequestBody3->append($data); $httpRequest3 = new \http\Client\Request('PUT', $host . '/file2.ico'); $httpRequest3->setBody($httpRequestBody3); $httpClient->reset(); $httpClient->enqueue($httpRequest3); $httpClient->send(); $httpResponse3 = $httpClient->getResponse(); echo sprintf("%s:%s\n", $httpResponse3->getResponseCode(), $httpResponse3->getResponseStatus()); Expected result: ---------------- 201:Created 204:No Content 201:Created Actual result: -------------- 201:Created 204:No Content 415:Unsupported Media Type