Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Request POST in perl script

by pallvimahajan (Initiate)
on Feb 17, 2020 at 06:35 UTC ( #11113041=perlquestion: print w/replies, xml ) Need Help??

pallvimahajan has asked for the wisdom of the Perl Monks concerning the following question:

HI Alll, I am very new to perl script, i want to transfer files from one server to another server through request POST.Kindly let me know where i am doing wrong . I want to transfer files from /tmp/Monitoring/finacleservices_a01gcbemcore1a_Core_tivoli.csv to another server in /<tp/scripts pathm/p>

#!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $url = 'http://serervIp.com:7052/tmp/scripts'; file_path = '/tmp/Monitoring/finacleservices_a01gcbemcore1a_Core_tivol +i.csv'; my $req = $ua->post($url, Content_Type => 'application/text', Content => [ file => [$file_path], ], );
but i am getting
HTTP1.1/(404 (NOT found) Connection close

Replies are listed 'Best First'.
Re: Request POST in perl script
by haukex (Chancellor) on Feb 17, 2020 at 07:59 UTC
    'http://serervIp.com:7052/tmp/scripts' ... HTTP1.1/(404

    If /tmp/scripts is a filesystem path on the server, and not a URL that is served by the webserver, then this is an issue on the server's side. You haven't given any information at all on the server, so we can't really say any more except that the server needs to expose some kind of service that lets you place files on the server file system - for example, that could be a CGI script, or a WebDAV service.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11113041]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2020-06-01 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?