bigup401 has asked for the wisdom of the Perl Monks concerning the following question:
i got some issue when i execute my code i get this Response Code: 411
#!/usr/bin/perl use strict; use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $ua = new LWP::UserAgent; my $senderid = "demo"; my $num = "447777777777"; my $sms = "demo"; my $rep = HTTP::Request->new(POST => "http://api.website.com/api/v1/sm +s/send/?apiKey=edftr44456&message=$sms%20HTTP%20API&from=$senderid&to +=$num"); $rep->content_type("application/x-www-form-urlencoded"); $rep->content_type("Content-Type' => 'application/json"); my $repobj = $ua->request($rep); my $repcode = $repobj->code; print 'Response code: ' . $repcode . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: http post
by 1nickt (Canon) on Feb 19, 2017 at 14:55 UTC | |
by bigup401 (Pilgrim) on Feb 19, 2017 at 17:05 UTC | |
by bigup401 (Pilgrim) on Feb 19, 2017 at 15:26 UTC | |
by bigup401 (Pilgrim) on Feb 19, 2017 at 15:31 UTC | |
|
Re: http post
by hippo (Archbishop) on Feb 19, 2017 at 14:31 UTC | |
by bigup401 (Pilgrim) on Feb 19, 2017 at 14:51 UTC | |
by hippo (Archbishop) on Feb 19, 2017 at 16:29 UTC |