heiths39 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use curl to hit Jira REST API. I don't want to feed via command line users password. So I'm trying to feed the password to curl. DOesn't seem to be working.
Always returns back an Unauthorized (401). I have tried many things. I tried feeding it a "\n" to. Tried using just "| ". Tried with and without sleep. I'm just not getting what is wrong. P.S. Also it clearly is asking for the password I can see the text and it returning the text from jira.my $u="USERNAME"; my $p="PASSWORD"; my $key="JIRA-NUMBER"; my $tempURL="/usr/bin/curl --user $u \"http://jira.company.com/rest/ap +i/latest/search?jql=KEY%20IN%20($key)\""; open (INFO,"|-", $tempURL); sleep 1; print INFO $p; my @DATAIN=<INFO>; print @DATAIN; my $data = join("",@DATAIN); print "What is data $data\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: open and curl
by choroba (Cardinal) on Jun 10, 2015 at 13:31 UTC | |
|
Re: open and curl
by dave_the_m (Monsignor) on Jun 10, 2015 at 17:07 UTC | |
by Anonymous Monk on Jun 10, 2015 at 18:06 UTC | |
by dave_the_m (Monsignor) on Jun 10, 2015 at 19:12 UTC | |
|
Re: open and curl
by Anonymous Monk on Jun 10, 2015 at 14:41 UTC |