perl post 上传文件

  • Post author:
  • Post category:其他



perl  post 上传文件
15/100
zhaoyangjian724


###列出组信息
use  LWP::UserAgent; 
use LWP;
use Encode;
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Headers;
use HTTP::Response;
use Encode;
use URI::Escape;
use URI::URL;
use JSON;
use Data::Dumper;
  if ( $#ARGV < 3 ){  
        print "please input your  username password  file repo_id!\n";
		print "just like 88888  1234567   aa.txt  'a3333a72-bb7f-477a-a7ed-7b05b029a9b9' ";
        exit(-1);
		};
  my $username=$ARGV[0];
  my $password=$ARGV[1];
  my $file=$ARGV[2];
  my $repo_id=$ARGV[3];
  my $ua = LWP::UserAgent->new;
  $ua->agent("Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101 Firefox/30.0");
  my $cookie_jar = HTTP::Cookies->new(
     file=>'lwp_cookies.txt',
     autosave=>1,
     ignore_discard=>1);
     $ua->cookie_jar($cookie_jar);
   my $token_url= 'http://x



版权声明:本文为zhaoyangjian724原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。