Get your <strong>HTTP Status Code</strong> Right

Today I noticed that a couple of big websites do prevent me from checking a URL’s HTTP Status Code via curl. See the following header response from a Medium-served custom-domain (doesn’t happen with medium.com URLs):

curl -I https://shift.newco.co/how-a-single-conversation-with-my-boss-changed-my-view-on-delegation-and-failure-ae5376451c8d
HTTP/1.1 409 Conflict

Error 409:

The request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request.

The server SHOULD generate a payload that includes enough information for a user to recognize the source of the conflict.

Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the representation being PUT included changes to a resource that conflict with those made by an earlier (third-party) request, the origin server might use a 409 response to indicate that it can't complete the request. In this case, the response representation would likely contain information useful for merging the differences based on the revision history.

I have no clue why this code is being shown, but please fix this, dear developers.

Here’s another example from LinkedIn posts:

curl -I https://www.linkedin.com/pulse/why-should-employers-care-families-rose-marcario

HTTP/1.1 999 Request denied

Yes, this is clearly a good idea. You see what Status Code 999 is? Don’t do that!

Written on as Note