Skip to content

Commit

Permalink
Merge pull request sirleech#15 from unwiredben/master
Browse files Browse the repository at this point in the history
A few more fixes from today -- added PATCH, more documentation updates to expand on tfnab's work
  • Loading branch information
tfnab committed Jan 9, 2012
2 parents 480ed3b + 6d450c6 commit 0b00b85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion WebServer.h
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions keywords.txt
Expand Up @@ -4,6 +4,9 @@ INVALID KEYWORD2
GET KEYWORD2
HEAD KEYWORD2
POST KEYWORD2
PUT KEYWORD2
DELETE KEYWORD2
PATCH KEYWORD2
begin KEYWORD2
processConnection KEYWORD2
setDefaultCommand KEYWORD2
Expand Down
20 changes: 12 additions & 8 deletions readme.md
Expand Up @@ -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
Expand All @@ -27,11 +27,15 @@ 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 chip won't work with the library as that requires more software support for implementating
the TCP/IP stack.

## Version history

Expand All @@ -41,10 +45,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

Expand Down

0 comments on commit 0b00b85

Please sign in to comment.