문제

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