 Name: svn:keywords
    + Id
 
+Index: ports/classes/net/xp_framework/unittest/peer/HttpRequestTest.class.php
+===================================================================
+--- ports/classes/net/xp_framework/unittest/peer/HttpRequestTest.class.php	(revision 12290)
++++ ports/classes/net/xp_framework/unittest/peer/HttpRequestTest.class.php	(working copy)
+@@ -196,6 +196,40 @@
+     }
+ 
+     /**
++     * Test HTTP PUT
++     *
++     */
++    #[@test]
++    public function put() {
++      $r= new HttpRequest(new URL('http://example.com/'));
++      $r->setMethod(HTTP_PUT);
++      $r->setParameters('a=b&c=d');
++      $this->assertEquals(
++        "PUT / HTTP/1.1\r\nConnection: close\r\nHost: example.com\r\n".
++        "Content-Length: 7\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n".
++        "a=b&c=d",
++        $r->getRequestString()
++      );
++    }
++
++    /**
++     * Test HTTP TRACE
++     *
++     */
++    #[@test]
++    public function trace() {
++      $r= new HttpRequest(new URL('http://example.com/'));
++      $r->setMethod(HTTP_TRACE);
++      $r->setParameters('a=b&c=d');
++      $this->assertEquals(
++        "TRACE / HTTP/1.1\r\nConnection: close\r\nHost: example.com\r\n".
++        "Content-Length: 7\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n".
++        "a=b&c=d",
++        $r->getRequestString()
++      );
++    }
++
++    /**
+      * Test HTTP HEAD
+      *
+      */
+@@ -211,6 +245,36 @@
+     }
+ 
+     /**
++     * Test HTTP DELETE
++     *
++     */
++    #[@test]
++    public function delete() {
++      $r= new HttpRequest(new URL('http://example.com/'));
++      $r->setMethod(HTTP_DELETE);
++      $r->setParameters('a=b&c=d');
++      $this->assertEquals(
++        "DELETE /?a=b&c=d HTTP/1.1\r\nConnection: close\r\nHost: example.com\r\n\r\n",
++        $r->getRequestString()
++      );
++    }
++
++    /**
++     * Test HTTP OPTIONS
++     *
++     */
++    #[@test]
++    public function options() {
++      $r= new HttpRequest(new URL('http://example.com/'));
++      $r->setMethod(HTTP_OPTIONS);
++      $r->setParameters('a=b&c=d');
++      $this->assertEquals(
++        "OPTIONS /?a=b&c=d HTTP/1.1\r\nConnection: close\r\nHost: example.com\r\n\r\n",
++        $r->getRequestString()
++      );
++    }
++
++    /**
+      * Test setHeader() method
+      *
+      */
 Index: ports/classes/net/xp_framework/unittest/peer/HttpResponseTest.class.php
 ===================================================================
 --- ports/classes/net/xp_framework/unittest/peer/HttpResponseTest.class.php	(revision 0)

     }
 
     /**
Index: skeleton/peer/http/SocketHttpTransport.class.php
===================================================================
--- skeleton/peer/http/SocketHttpTransport.class.php	(revision 0)

       
       // Which HTTP method? GET and HEAD use query string, POST etc. use
       // body for passing parameters
       switch ($this->method) {
-        case HTTP_HEAD:
-        case HTTP_GET:
+        case HTTP_HEAD: case HTTP_GET: case HTTP_DELETE: case HTTP_OPTIONS:
           if (NULL !== $this->url->getQuery()) {
             $target.= '?'.$this->url->getQuery().(empty($query) ? '' : $query);
           } else {
@@ -124,8 +150,7 @@
           $body= '';
           break;
           
-        case HTTP_POST:
-        default:
+        case HTTP_POST: case HTTP_PUT: case HTTP_TRACE: default:
           $body= substr($query, 1);
           if (NULL !== $this->url->getQuery()) $target.= '?'.$this->url->getQuery();
           $this->headers['Content-Length']= strlen($body);
@@ -144,27 +169,10 @@
       
       // Add request headers
       foreach ($this->headers as $k => $v) {
