Skip to content

Instantly share code, notes, and snippets.

@hiroyukim
Created October 16, 2009 11:39
Show Gist options
  • Save hiroyukim/211757 to your computer and use it in GitHub Desktop.
Save hiroyukim/211757 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common 'POST';
my @file_paths = @ARGV;
my $user_id = q{};
my $passwd = q{};
my $ua = LWP::UserAgent->new;
$ua->credentials( 'api.wassr.jp:80', 'API Authentication', $user_id, $passwd, );
my $res = $ua->request(
POST('http://api.wassr.jp/statuses/update.json',
Content_Type => 'form-data',
Content => {
status => 'test',
image => \@file_paths,
},
)
);
warn $res->content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment