curl --write-out %{http_code} --silent --output /dev/null URL
getHTTPCode () { echo $(curl --write-out %{http_code} --silent --output /dev/null $1)}
response=$(getHTTPCode URL)echo $response
No comments:
Post a Comment