I created a REST server and now I want to quickly test it with a Perl client using the REST :: Client module.
It works fine if I execute a GET Request (explicitly setting parameters in the URL), but I cannot figure out how to set these parameters in POST requests.
This is what my code looks like:
#!/usr/bin/perl use strict; use warnings; use REST::Client; my $client = REST::Client->new(); my $request_url = 'http://myHost:6633/my_operation'; $client->POST($request_url); print $client->responseContent();
I tried something similar to:
$client->addHeader ('my_param' , 'my value');
But this is clearly wrong, since I do not want to set a predefined HTTP header, but a request parameter.
Thanks!
Javier alba
source share