visionmedia/superagent — pull request #58 by DamonOehlman (2012-01-25 03:25:11+00:00)
Title: DELETE Query String Handling

Hey TJ,

Just started writing a Couch client on top of super agent ([SuperComfy](https://github.com/sidelab/supercomfy)) and I started seeing problems when writing my DELETE tests for Couch documents. I'm not 100% sure, but it seems that a DELETE request should support query string parameters in much the same way as a GET request.

I've done a bit of reading on the topic (http://stackoverflow.com/questions/5905916/payloads-of-http-request-methods and http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-14#page-20), and while nothing is hard and fast it does seem like that is the general case. It certainly is the case with Couch as primarily the way to remove a document is by using the DELETE method and pass a revision through a querystring parameter.

Anyway, I've made some minor tweaks to the code and updates to the querystring node tests to check things operate in the way they should. Additionally, I've mirrored the updates to the superagent client side files (whole reason for writing SuperComfy is to get a client that works client side as well as in node). I haven't written any tests here though - once I've got a better understanding of the client side tests I'll try to do that as well.

If you need me to make any tweaks, or if having a DELETE method support query string parameters is something you'd rather leave out of SuperAgent, please let me know.

Cheers,
Damon.