Jithin Justice
Jithin Justice

Reputation: 241

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?

Upvotes: 0

Views: 2055

Answers (1)

MarkHu
MarkHu

Reputation: 1869

This isn't really a Jenkins question/answer but try this:

curl -i -s IP:port/path

Upvotes: 0

Related Questions