简体   繁体   中英

How to call REST API to external server from Jenkins

I want to implement that when a build is performed in Jenkins, call my server Rest API.

Calling Jenkins REST API on my server to perform Build was successful.

在此处输入图像描述

How to call external server REST API in Jenkins? is it impossible?

There are multiple ways to do this. One option is, you can use something like the HTTP Request Plugin . Then in your Post step, you can do the HTTP request like below.

def response = httpRequest 'https://your_host/something'

Another option is to simply use something like curl to send an HTTP request. You can execute your curl command within a sh block.

sh "curl -vk https://your_host/something"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM