bangor has asked for the wisdom of the Perl Monks concerning the following question:
This is the code I have tried:POST /endpoint?user=yyy&pass=zzz HTTP/1.1 Host: api.xxx.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4 +YWxkTrZu0gW ----WebKitFormBoundary7MA4YWxkTrZu0gW
The requestmy $url = 'https://api.xxx.com/endpoint?user=yyy&pass=zzz'; my $request = HTTP::Request->new( 'POST', $url ); $request->content_type('multipart/form-data'); print $request->as_string; my $response = $ua->request($request); print $response->as_string;
The response:POST https://api.xxx.com/endpoint?user=yyy&pass=zzz Content-Type: multipart/form-data
How can I get HTTP::Request to do this. I tried giving it a content of empty string but no different. TIA for any helpHTTP Error 411. The request must be chunked or have a content length.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: POST request problem
by Corion (Patriarch) on Jun 03, 2016 at 13:31 UTC | |
by bangor (Monk) on Jun 03, 2016 at 13:37 UTC | |
by Corion (Patriarch) on Jun 03, 2016 at 13:41 UTC | |
by bangor (Monk) on Jun 03, 2016 at 13:54 UTC | |
by Corion (Patriarch) on Jun 03, 2016 at 14:11 UTC | |
|
Re: POST request problem
by Anonymous Monk on Jun 04, 2016 at 00:36 UTC | |
|
Re: POST request problem
by hippo (Archbishop) on Jun 03, 2016 at 15:49 UTC | |
by bangor (Monk) on Jun 03, 2016 at 16:07 UTC | |
by hippo (Archbishop) on Jun 03, 2016 at 16:14 UTC | |
by bangor (Monk) on Jun 03, 2016 at 16:35 UTC | |
by RonW (Parson) on Jun 03, 2016 at 22:04 UTC | |
by Anonymous Monk on Jun 04, 2016 at 00:11 UTC | |
|
Re: POST request problem
by papidave (Pilgrim) on Jun 06, 2016 at 13:40 UTC |