From a1449c26235eb76c56cead6da6adc9d83cb9e4c8 Mon Sep 17 00:00:00 2001 From: unwiredben Date: Mon, 9 Jan 2012 06:39:48 -0600 Subject: [PATCH 1/3] Add HTTP PATCH method support too --- WebServer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebServer.h b/WebServer.h index 1501b84..f6cea28 100644 --- a/WebServer.h +++ b/WebServer.h @@ -147,7 +147,7 @@ class WebServer: public Print { public: // passed to a command to indicate what kind of request was received - enum ConnectionType { INVALID, GET, HEAD, POST, PUT, DELETE }; + enum ConnectionType { INVALID, GET, HEAD, POST, PUT, DELETE, PATCH }; // any commands registered with the web server have to follow // this prototype. @@ -1041,6 +1041,8 @@ void WebServer::getRequest(WebServer::ConnectionType &type, type = PUT; else if (expect("DELETE ")) type = DELETE; + else if (expect("PATCH ")) + type = PATCH; // if it doesn't start with any of those, we have an unknown method // so just get out of here From 38e39fed75b1d0396933b4b8765a64e45d397212 Mon Sep 17 00:00:00 2001 From: unwiredben Date: Mon, 9 Jan 2012 17:34:10 -0600 Subject: [PATCH 2/3] Add PUT,DELETE,PATCH to keywords.txt Update readme.md with PATCH and link to hardware pages for Ethernet boards --- keywords.txt | 3 +++ readme.md | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/keywords.txt b/keywords.txt index b2c301b..f72c5a9 100644 --- a/keywords.txt +++ b/keywords.txt @@ -4,6 +4,9 @@ INVALID KEYWORD2 GET KEYWORD2 HEAD KEYWORD2 POST KEYWORD2 +PUT KEYWORD2 +DELETE KEYWORD2 +PATCH KEYWORD2 begin KEYWORD2 processConnection KEYWORD2 setDefaultCommand KEYWORD2 diff --git a/readme.md b/readme.md index 74dbacd..b30c80e 100644 --- a/readme.md +++ b/readme.md @@ -5,7 +5,7 @@ This is an Arduino-based Web Server library, originally developed for a class at ## Features - URL parameter parsing -- Handle the following HTTP Methods: GET, HEAD, POST, PUT, DELETE +- Handle the following HTTP Methods: GET, HEAD, POST, PUT, DELETE, PATCH - Web Forms - Images - JSON/RESTful interface @@ -27,11 +27,14 @@ If you get an error message when building the examples similar to "WebServer.h n These have all been tested with the library successfully: -- Freetronics Etherten -- Freetronics Ethernet Shield -- Arduino Ethernet Shield, both original and updated microSD version -- Adafruit Ethernet Shield w/ Wiznet 811MJ module -- NKC Electronics Ethernet Shield DIY Kit +- [Freetronics Etherten](http://www.freetronics.com/products/etherten) +- [Freetronics Ethernet Shield](http://www.freetronics.com/products/ethernet-shield-with-poe) +- [Arduino Ethernet](http://arduino.cc/en/Main/ArduinoBoardEthernet) +- [Arduino Ethernet Shield, both original and updated microSD version](http://arduino.cc/en/Main/ArduinoEthernetShield) +- [Adafruit Ethernet Shield w/ Wiznet 811MJ module](http://www.ladyada.net/make/eshield/) +- [NKC Electronics Ethernet Shield DIY Kit](http://store.nkcelectronics.com/nkc-ethernet-shield-diy-kit-without-wiz812mj-mod812.html) + +Shields using the Microchip ENC28J60 ## Version history @@ -41,10 +44,10 @@ These have all been tested with the library successfully: - fixed Google Code issue [8](http://code.google.com/p/webduino/issues/detail?id=8) by adding WEBDUINO_NO_IMPLEMENTATION macro that allows including the class definition without the implementation code - fixed Google Code issue [9](http://code.google.com/p/webduino/issues/detail?id=9): allowing prog_char* strings for printP - added httpServerError() method to output 500 Internal Server Error message -- added support for HTTP PUT and DELETE methods (see Google Code issue [11](http://code.google.com/p/webduino/issues/detail?id=11) +- added support for HTTP PUT, DELETE, and PATCH methods (see Google Code issue [11](http://code.google.com/p/webduino/issues/detail?id=11) - fixed Google Code issue [12](http://code.google.com/p/webduino/issues/detail?id=12): off-by-one error in name/value parser (readPOSTparam) where the buffer wouldn't ever be completely filled - updated copyright string for 2012 and major authors -- GitHub fork now the official version; all open issues on Goole Code site fixed or closed and moved to GitHub +- GitHub fork now the official version; all open issues on Google Code site fixed or closed and moved to GitHub ### 1.6 released in Jan 2012 From 6d450c612ff9866444701c6dc1cafcbe4563fef9 Mon Sep 17 00:00:00 2001 From: unwiredben Date: Mon, 9 Jan 2012 17:36:06 -0600 Subject: [PATCH 3/3] Complete readme message about incompatible hardware --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b30c80e..2ef7e78 100644 --- a/readme.md +++ b/readme.md @@ -34,7 +34,8 @@ These have all been tested with the library successfully: - [Adafruit Ethernet Shield w/ Wiznet 811MJ module](http://www.ladyada.net/make/eshield/) - [NKC Electronics Ethernet Shield DIY Kit](http://store.nkcelectronics.com/nkc-ethernet-shield-diy-kit-without-wiz812mj-mod812.html) -Shields using the Microchip ENC28J60 +Shields using the Microchip ENC28J60 chip won't work with the library as that requires more software support for implementating +the TCP/IP stack. ## Version history