Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl REST: How to send DELETE request with some data (sic!)?

There is a web service, that working with data in it's onDelete method; so, I need to transfer some data with my DELETE request... And I actually have completely no idea how to do that in Perl :(

Does anyone have any ideas about that? Maybe, someone met the same problem and solved it?

like image 273
No Way Avatar asked Jan 31 '26 01:01

No Way


1 Answers

The same way as you would send a POST request, I believe:

$ perl -MLWP::UserAgent -e 'LWP::UserAgent->new->delete("http://localhost:9999/resource", Content => "data");'

On the debug side of a connection:

$ socat tcp-listen:9999 -
DELETE /resource HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost:9999
User-Agent: libwww-perl/6.04
Content-Length: 4

data
like image 112
creaktive Avatar answered Feb 01 '26 13:02

creaktive



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!