Вопрос

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?

Это было полезно?

Решение

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
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top