Microsoft
Software
Hardware
Network
Question : Curl: how to get httpcode in Bash
Hi experts,
I know that I can use
curl -o $WEBSITEID "$URL"
to retrieve data from a url, however how to check if the retrieval is successful or not? In other words, how to get the response code (such as "200", or "404")?
Thanks for your replies.
Answer : Curl: how to get httpcode in Bash
1:
status=$(curl -s --head "$URL" | awk '/HTTP/ {print $2})
Open in New Window
Select All
Random Solutions
Windows Explorer Has Stopped Working
pthread_mutex_t vs sem_t
scan as editable text with graphic into Ms word looks awful
How to remove old ICA client settings?
Why did my site drop from number two on google to nowhere to be found?
XP_SQLMAINT
How to physical drive size using TSQL Queries in SQL Server 2005
How do you handle nulls in CFScript
How do I restrict users from listening to streaming music with Group Policy?
Implementing a VPN connection to a MySql database