Feature #1675
closed[W::Http] Request method : DELETE
0%
Description
Hello,
We are currently building our RESTful API, trying to respect the standards.
http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_services
We would like to use the DELETE method and it is not yet implemented in Wt.
There are only few things to change, could it be added to the next version ?
I can even provide you the files if you want.
Regards,
Thomas
Files
Updated by Koen Deforche almost 12 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
- Target version set to 3.3.0
Hey Thomas,
This indeed seems like a small change which we might still slip in the 3.3.0 release.
If you have already a patch ready, that would be convenient indeed.
Regards,
koen
Updated by Thomas Saquet almost 12 years ago
Hello Koen,
The attached file is a diff patch to add delete HTTP method to Wt.
I added a deleteRequest method to Client class. I had to add "Request" at the end because I could not use the reserved word delete. I did not know how you would put everything in order (deprecating get / post and add getRequest / postRequest or doing it another way) so i let it like that.
I added the header treatment previously dedicated to POST to PUT and DELETE since the content-length parameter is mandatory.
Moreover, there are many HTTP methods that are standard, non-standard or still in draft state (ref : http://annevankesteren.nl/2007/10/http-methods). I think it would be a good idea to add a custom behaviour. However it implies more changes, I can prepare that for a next release if you want.
Do not hesitate to contact me if you want me to change something.
Regards,
Thomas
Updated by Koen Deforche almost 12 years ago
- Status changed from InProgress to Resolved
Hey Thomas,
This looks fine to me. I applied as is. I have no special feeling about the deleteRequest() method --- it is syntactic sugar for the request() method anyway.
Regards,
koen
Updated by Thomas Saquet almost 12 years ago
Hello Koen,
Great :)
What about the custom behaviour ? Should I get it ready for the next release ?
Thank you !
Regards,
Thomas
Updated by Koen Deforche almost 12 years ago
Hey Thomas,
Yes we should allow flexibility here, and we are open for any changes needed.
Regards,
koen
Updated by Koen Deforche almost 12 years ago
- Status changed from Resolved to Closed