Wapp

Add support for PUT, PATCH, DELETE methods
Login

Add support for PUT, PATCH, DELETE methods

(1) By Oleg (oleg4tcltk) on 2020-02-14 14:28:15 [source]

Hello.

It would be very comfortable for RESTful application to support PUT, PATCH and DELETE methods too.

--- wapp.tcl    2020-02-14 17:26:25.291733285 +0300
+++ ../wapp.tcl 2020-02-13 18:59:57.199301706 +0300
@@ -525,7 +525,7 @@
   if {$hdr==""} {return 1}
   set req [lindex $hdr 0]
   dict set W REQUEST_METHOD [set method [lindex $req 0]]
-  if {[lsearch {GET HEAD POST} $method]<0} {
+  if {[lsearch {GET HEAD POST PUT PATCH DELETE} $method]<0} {
     error "unsupported request method: \"[dict get $W REQUEST_METHOD]\""
   }
   set uri [lindex $req 1]