sub uploadCodeCoverageZip { # Verify everything and if it checks out call the WSDL. Otherwise just return error my $self = shift(); my $ret = "Unknown Error\n"; # get an xml from xml::simple my $ws_request = createCodeCoverageObject( password => $self->{password}, coverageType => $self->{coverageType}, buildVersion => $self->{buildVersion}, testPlanId => $self->{testPlanId}, loginId => $self->{loginId}, cloverFilePath => $self->{cloverFilePath}, ); my $multipart = MIME::Entity->build(Type => "multipart/mixed"); # this might work but gives a Not a scalar reference when used as request content my $url = 'http://someserver.com/path/to/ws'; '#'my server my $ua = LWP::UserAgent->new; my $h = HTTP::Headers->new; my $file = '/etc/passwd'; # Name the file open(INFO, $file); # Open the file my @lines = ; # Read it into an array close(INFO); $h->header('Content-Type' => 'multipart/mixed', Accept=>'application/json','Cookie', $by->{cookie},'User-Agent', $self->getUserAgent()); my @ws_result_array = (); # approximating the post request push (@ws_result_array, '--Boundary'); push (@ws_result_array, $ws_request); push (@ws_result_array, '--Boundary'); push (@ws_result_array, @lines); my $GetReq = HTTP::Request->new( 'POST', $url, $h, @ws_result_array // not sure what to put here ); print $GetReq->as_string; my $resp = $ua->request($GetReq); print $resp->decoded_content; return "eod"; }