fabiobento512 / FRequest

FRequest - A fast, lightweight and opensource desktop application to make HTTP(s) requests
https://fabiobento512.github.io/FRequest
GNU General Public License v3.0
164 stars 14 forks source link

DELETE request body #31

Open tiggerbiggo opened 4 months ago

tiggerbiggo commented 4 months ago

Hi,

I understand that the spec regarding a body in a DELETE request is not recommended, but some APIs ignore this common best practice and demand a body in a delete request.

Since it is not forbidden by the spec, and it seems increasingly to be the trend that endpoints are ignoring the history of this request type, I end up needing to switch to cURL more and more frequently to make these requests in the real world. I would much rather use FRequest for all my testing since it provides a nice interface and saves all my settings in the way that works for me.

I would like to request that body in DELETE be made available, even if a warning is deemed necessary to discourage people from using it. This would allow me to use these endpoints with FRequest, instead of needing other software just for DELETE with body specifically.

At a quick glance it looks to me like the change would be to move line 106 of utilfrequest.cpp to the true case, but I don’t really do cpp myself so I can’t build it easily to test for bugs with that potentially naive approach to a code base i’m not familiar with.

If you decide this isn’t suitable for the public release version but can confirm this change would work, i’ll probably learn how to build it myself so I can make a copy that works for my use case specifically. The magic of open source :)

Thanks, this app is really neat.

fabiobento512 commented 3 months ago

Hello,

Thanks for your suggestion. This is something that I should have a look. Possibly we could add a project specific setting to allow those kind of not recommend requests / practices.

Unfortunately lately I have not been able to spend much time in this project due to personal reasons and also because that at work I have not been working much with REST apis anymore, I have tried there JSON RPC (with websockets) which I kinda became a fan of.

At a quick glance it looks to me like the change would be to move line 106 of utilfrequest.cpp to the true case, but I don’t really do cpp myself so I can’t build it easily to test for bugs with that potentially naive approach to a code base i’m not familiar with.

From a quick look it seems you are correct, changing that to true should allow you to have a body in DELETE. Even if you don't have experience with C++ you should be able to change it without a problem (for personal use), I would suggest that you clone the project, as it already contains a github action file that will build the application for you. So I think you can clone it, change that line on a new commit, and github should provide you a new build with what you need.

Thanks, this app is really neat.

Thank you, it is always nice to hear that the application is useful to others.