Try something like this
http://stackoverflow.com/questions/508565/how-to-make-an-authenticated-web-request-in-powershellit
looks like you need to authenticate as a user in the Jenkins user
database first. This should allow you to do that
On Apr 2, 2014 7:48 AM, "Ren Jith" <sachr...@gmail.com> wrote:

> @Eric : I want the config.xml file. Rest API xml file not contain what I
> want.
>
> @Mark : I already followed this link. But it didn't helped me.
>
> Have any other solutions. What I want is to get all the svn repos
> configured in a job. Rest API xml contains the configured repo as well as
> its externals. I cant filter the original repos from that xml file.
>
>
> On Wed, Apr 2, 2014 at 7:10 PM, Mark Waite <mark.earl.wa...@gmail.com>wrote:
>
>> I think you need to authenticate your API client.
>>
>>
>> https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clientsprovides
>>  some hints (though not written in PowerShell).
>>
>> Mark Waite
>>
>>
>> On Wed, Apr 2, 2014 at 7:28 AM, Eric Pyle <eric.p...@cd-adapco.com>wrote:
>>
>>>  Try using 
>>> https://myjenkins:8443/hudson/job/myProj/api/xml<https://myjenkins:8443/hudson/job/myProj/config.xml><https://myjenkins:8443/hudson/job/myProj/config.xml>
>>>
>>> Eric
>>>
>>>  On 4/2/2014 8:39 AM, Ren Jith wrote:
>>>
>>> Hi all,
>>>
>>> I am new to this forum, Please help me to find a solution to my problems.
>>>
>>> Our company has a Jenkins server. I am a user on this Jenkins server. I
>>> want to load the config.xml file of a specific job to PowerShell variable.
>>> I am using code like,
>>>
>>> $url ="https://myjenkins:8443/hudson/job/myProj/config.xml";
>>> [xml]$xmld = (New-Object System.Net.WebClient).DownloadString($url)
>>> //loading the xml file
>>>
>>>
>>> But this is not working. Sometimes an error gets like
>>>
>>> The server committed a protocol violation. Section=ResponseStatusLine"
>>> When some times i used the http connection I got a different error like
>>> exception calling "DownloadString" with "1" argument(s): "The remote server 
>>> returned an error: (403) ForbiddenAfter all this stuff i just tested with 
>>> 'wget.exe' There also an error comes like,
>>>  HTTP request sent, awaiting response... 403 Forbidden
>>> 2014-04-01 16:52:25 ERROR 403: Forbidden.
>>> I can't figure out the exact problem.Please help me? I know this is related 
>>> to the jenkins security issue.
>>> That's why i am posting this here.
>>> Thanks,
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Thanks!
>> Mark Waite
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to