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
Setting up invoicing system
Conect to citrix Metarframe Server thru mobile 3G and GPRS card
Display multiple records in form using a group by query
Blackberry vs. Windows Mobile comparison - esp public folders
Photoshop change color
How do I make default "Program Files" folder somewhere else?
Coldfusion output in javascript
Get Param from File not via post get method
Norton Ghost image 8.2 and Window 2003 on HP DL380 & RAID
Exchange Defrag and Windows Defragmenter?