Do you have access to powershell? 

http://superuser.com/questions/344927/powershell-equivalent-of-curl looks 
possibly handy. 

(calling from pipeline script should be fine, but I can't find an example 
of how best to do it. Some comment that blocking for an external thing is 
not ideal.. vs a shell script which will do the right thing if you have it 
available). 

https://www.cloudbees.com/blog/jenkins-workflow-creating-class-wrap-access-secured-http-endpoint
 
shows an extension that calls a remote jenkins with form auth, which isn't 
quite what you want, but it is calling https from within a workflow 
scripting using the global library, so you may be able to follow along but 
do your own. 



On Monday, February 1, 2016 at 9:49:11 AM UTC+11, Scott Richmond wrote:
>
> The httpbuilder library doesn’t appear to work as it’s not available. Do I 
> have to add it to the default libraries or something?
>
>  
>
> Sent from Outlook Mail <http://go.microsoft.com/fwlink/?LinkId=550987> 
> for Windows 10 phone
>
>  
>
>  
>
>
> *From: *Craig Rodrigues
> *Sent: *Sunday, 31 January 2016 10:08 PM
> *To: *Jenkins Users
> *Cc: *s.t.ri...@gmail.com <javascript:>
> *Subject: *Re: How can I POST data to a remote service in Jenkins 
> pipeline/workflow?
>
>  
>
>  
> Hi,
>
> curl is one way of calling a REST API from the command-line, but it
> is not the only way.  You can create a Jenkins job, and 
> use many languages to call REST API's inside these jobs,
> even on Windows.
>
> For example, if you want to use groovy, using the HTTPBuilder library
> is one way to do it:
> https://www.google.com/search?q=groovy+rest+api
>
> If you want to use C#, you can look at using the restsharp library:
> https://www.google.com/search?q=c+sharp+rest+api
>
> --
> Craig
>
>
> On Sun, Jan 31, 2016 at 9:20 AM, Scott Richmond <s.t.ri...@gmail.com 
> <javascript:>> wrote:
>
>> I require the ability to HTTP POST data to a remote service via some kind 
>> of REST client. This will be done on Windows agents, so the native curl 
>> support in sh is not suitable. Is there any way to do this in the groovy 
>> script?
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2a884b8e-625b-4c85-981c-81a1ccf4c59a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to