Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 2
    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! Commented Aug 19, 2021 at 20:28
  • I would get rid of the -I so it does a normal GET instead of a HEAD request. Commented Mar 9, 2023 at 18:32