简体   繁体   中英

How to use CURL command inside Jenkins for retrieving status code?

I am using CURL command in jenkins for retrieving "status code" of an ip. I did the following command in terminal and it is working properly.

curl -i ip_address:port

Output of terminal

HTTP/1.1 200 OK

But in the case of jenkins,

I added the above command inside "Execute shell" It is the giving error with the following output.

curl -i ip_address:port

% Total % Received % Xferd AverageDload Speed Upload TimeTotal

0 0 0 0 0 --:--:--
TimeSpent TimeLeft CurrentSpeed

--:--:-- --:--:-- --:--:--
curl: Failed to connect to ip_address port : Connection refused

Can anyone suggest a solution for the same?

这实际上不是詹金斯问题/答案,但是请尝试以下操作:

curl -i -s IP:port/path

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