On Tuesday, 31 January 2017 02:34:13 UTC+5:30, Christopher Burke wrote:
>
> Hey everyone
>
>    Part of my build pipeline requires that I publish a zip file to a 
> server, so I'm trying the following:
>
> response = httpRequest httpMode: 'POST', contentType: 
> 'APPLICATION_OCTETSTREAM', body:"...", url: "${urlForPublish}"
>
>    I'm not sure how to specify the body correctly, though. Could anyone 
> point me to an example or offer any suggestions? In the meantime, I've 
> worked around this by using curl, but it seems like using the httpRequest 
> step would be preferable.
>
>    Thanks,
>
>    --- Chris
>
> ------------------------
>
This worked for Me : 

def response =  httpRequest(acceptType: 'APPLICATION_JSON', contentType: 
'APPLICATION_ZIP',
                         customHeaders  : [[name: "authorization" , value : 
"${authToken}"],[name: 'x-username' , value: 'admin']],
                         httpMode: 'POST', ignoreSslErrors: true, 
multipartName: 'AppDefenseBundle.zip', timeout: 900,

                         responseHandle: 'NONE', uploadFile: 
"${bundleUploadPath}", url: "${url}") 

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f5877e61-7968-40de-bf0d-f5fb2c1beebe%40googlegroups.com.

Reply via email to