in reply to http post

Your POST request appears to have no body which is why you are seeing the HTTP response code 411. See the example in the LWP documentation for how to construct the body of a POST request.

Replies are listed 'Best First'.
Re^2: http post
by bigup401 (Pilgrim) on Feb 19, 2017 at 14:51 UTC

    its the same when i try the same example i get the same error 411 Length Required

      Forgive my scepticism but I rather suppose that isn't the case. Here's the SSCCE you should have supplied. It gives a 301.

      #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $rep = HTTP::Request->new (POST => "http://api.website.com/api/v1/s +ms/send/"); $rep->content_type ("application/json"); $rep->content ('{ "foo": "bar" }'); my $res = $ua->request($rep); print 'Response code: ' . $res->code . "\n";