Timeline for Getting curl to output HTTP status code?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 9, 2023 at 18:32 | comment | added | PolyTekPatrick | I would get rid of the -I so it does a normal GET instead of a HEAD request. | |
Aug 19, 2021 at 20:28 | comment | added | Jimmy Adaro |
This one works like a charm, specially when using curl between Docker containers. I use it like this in PHP: exec("curl -LI "my service name"/"the file I'm looking the HTTP code for" -o /dev/null -w '%{http_code}\n' -s") (e.g.: exec("curl -LI static/someimage.jpg -o [...] where "static" is the service name defined in Docker Compose). Thanks!
|
|
Apr 25, 2018 at 9:12 | history | edited | mahatmanich | CC BY-SA 3.0 |
added 2 characters in body
|
Feb 8, 2017 at 10:44 | history | answered | mahatmanich | CC BY-SA 3.0 |