A server is running on 5000 port. I have to write a bash script to cURL that URL and parse the response. Here the problem is server can run on either http or https protocol. That means I have curl either https://serverip:5000 or http://serverip:5000.For now, first I'm checking with http request. If that request fails then I'm checking https. Is there any way that cURL can automatically detect that server running on http or httpsand request to it?
cURL: Request to http and https by default
shell script;curl