The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
httpRequest: Perform an HTTP Request and return a response objectPerforms an HTTP request, and returns a response object.
Usage example:
def response = httpRequest 'http://localhost:8080/jenkins/api/json?pretty=true'
println("Status: "+response.status)
println("Content: "+response.content)
If Jenkins restarts after the HTTP request is made, but before the HTTP response is received, the HTTP request fails.
validResponseCodes is a comma-separated string of single values or from:to ranges. For example '200' to accept only 200 or '201,301:303' to accept 201 as well as the range from 301 to 303.
The methods of the response object are:
url
StringacceptType (optional)
Accept: foo HTTP request header where foo is the HTTP content type to accept.
NOT_SET, TEXT_HTML, TEXT_PLAIN, APPLICATION_FORM, APPLICATION_JSON, APPLICATION_JSON_UTF8, APPLICATION_TAR, APPLICATION_ZIP, APPLICATION_OCTETSTREAMauthentication (optional)
StringconsoleLogResponseBody (optional)
booleancontentType (optional)
Content-Type: foo HTTP request header where foo is the HTTP content type the request is using.
NOT_SET, TEXT_HTML, TEXT_PLAIN, APPLICATION_FORM, APPLICATION_JSON, APPLICATION_JSON_UTF8, APPLICATION_TAR, APPLICATION_ZIP, APPLICATION_OCTETSTREAMcustomHeaders (optional)
name
Stringvalue
StringmaskValue
booleanhttpMode (optional)
GET, HEAD, POST, PUT, DELETE, OPTIONS, PATCHhttpProxy (optional)
StringignoreSslErrors (optional)
booleanmultipartName (optional)
StringoutputFile (optional)
StringproxyAuthentication (optional)
Stringquiet (optional)
booleanrequestBody (optional)
The raw body of the request.
Parameters will be resolved.
StringresponseHandle (optional)
NONE, LEAVE_OPEN, STRINGtimeout (optional)
intuploadFile (optional)
StringuseNtlm (optional)
booleanuseSystemProperties (optional)
booleanvalidResponseCodes (optional)
StringvalidResponseContent (optional)
StringwrapAsMultipart (optional)
booleanPlease submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.