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
Repair mysql database table
How to create/use Exchange as a "store and forward" or secondary email server?
OWALOGON.ASP Problems
WINDOWS FILE PROTECTION - unrecognized file versions
EventID: 1054
mysqldump , how to check for errors
Windows XP Home and Outlook Express 6
Stop thumbnail caching with group policy
Blue screen error - Probably caused by : ntoskrnl.exe ( nt!ExFreePoolWithTag+436 ) ??? - 2003 ent ed.
epson dfx-9000 printer driver