This patch depends on the patch I've made for http-parser.
It adds support for 4 new HTTP request methods to be parsable and handleable with an http.Server. The new methods are M-SEARCH, NOTIFY, SUBSCRIBE, and UNSUBSCRIBE.
Also included is a test script testing for the M-SEARCH request method, and the * url.
Add support for 'M-SEARCH' and 'NOTIFY' HTTP request methods, with si…
…mple test script.
Added support for 'SUBSCRIBE' and 'UNSUBSCRIBE' HTTP request methods.
ugh. more http methods? where do these come from?
Ugghh, indeed. These ones come from UPnP specifications.
Side Note: I hate the hard-coding of the HTTP methods personally, especially since http.Client doesn't have that same restriction (you can send arbitrary HTTP methods without modifying the source). If we modified the parser to return a String of the method, rather than an enum, we could probably save code and not have to worry about implementing any other HTTP methods as they come up. Thoughts?
I want to discourage people from thinking that extension methods are an acceptable idea. The change needs to be done at the parser level... However I think the http zealots may win out on this. mnot mentioned that he also wants extension methods...
It's not so much extension methods that I care about. Personally I think that they're a terrible idea, and that the 4 new method's I'm introducing could have been better taken care of using POST and special URI's or something similar. But, as it is, I'm against discriminating against certain "extension" methods while there's still a good amount of them already in the parser. That's why I feel like keeping node and the parser HTTP-method-agnostic is a good idea, so that as new specs continue coming, the parser/node don't need to continually be updated to reflect.
In the end ry, I'm just trying to implement UPnP through Node. 90% of it is HTTP-based (though at times with unconventional methods), so I figured using Node's HTTP library was entirely appropriate, but I needed to implement those few HTTP methods to do it right.
M-SEARCH?? what the hell.. lol
1255438 closes this....