3

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
No Way
  • 183
  • 9
  • 1
    DELETE command is similar to GET, so you can request url like `/method?param=123` – Galimov Albert Dec 06 '12 at 11:12
  • Hm... I think that's a good idea... I have data in XML format, about 200-300 bytes. If I url-encode it and send as you've said, I think it will do the trick. Thanks! – No Way Dec 06 '12 at 11:19

1 Answers1

2

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
creaktive
  • 5,193
  • 2
  • 18
  • 32