PHPNews

502 Bad Gateway

HTTP is a protocol that is implemented by servers and clients, but there is a third category: proxies. When a system is acting as a proxy for a different server, and that server is misbehaving or doing something unexpected, the proxy can return 502 Bad Gateway to tell a client that the proxy is working fine, …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday July 16, 2019


501 Not Implemented

A server can return 501 Not Implemented when it doesn’t support a certain feature. The RFC specifically lists ‘not supporting a specific HTTP method on any resource’ as an example of this. In most practical cases this is similar enough to 405 Method Not Allowed , and 405 is probably the clearer status code …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday July 9, 2019


500 Internal Server Error

While the 4xx-series errors are specifically for client-side errors, the 5xx-series errors are for server-side errors. A server-side error generally means that there is a bug or outage. If you are developing a client and you encounter a 5xx-range error, generally you can assume it wasn’t your fault, and it might …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday July 2, 2019


451 Unavailable For Legal Reasons

If a server refuses to serve content for legal reasons, it can use the 451 Unavailable For Legal Reasons status code. Examples of this could include government censorship, or DMCA takedown requests. In many cases when a country censors certain information, it’s also not allowed to discuss that the content …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday June 25, 2019


431 Request Header Fields Too Large

When a client sends a HTTP request with HTTP headers that are too big, a server can use 431 Request Headers Fields Too Large in response. This response can be used if either the total size of all headers exceeded some limit, or if there are individual headers that are too big. If a client sees a 431 , it …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday June 18, 2019


Blog archive in space

I’ve been writing articles on this blog for about 13 years, and for a while now I’ve marked all of the 400ish articles with geo tags. This blog is Jekyll -based. To add Geo tags, all I had to do was add the information to the ‘front-matter’. Here’s the header of a sample post: title: "Browser tabs are …

Continue reading »

Written by Evert Pot - - Aggregated on Monday June 17, 2019


Browser tabs are probably the wrong metaphor

Back when Internet Explorer was dominant, and every developer I knew installed Firefox on every family member and their dogs desktop, I remember a big selling point for convincing people to use Firefox was ‘Tabs’. Firefox may not have been the first browser to introduce tabs, but in my experience it was the number …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday June 11, 2019


430 Would Block

If you look at lists of HTTP status-codes, you might notice that there’s a gap between 429 Too Many Requests and 431 Request Header Fields Too Large . I find this interesting, so I did some digging and it turns out that around the same time 429 and 431 there was another status code that never made it into a …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday June 11, 2019


429 Too Many Requests

If an service wants to limit the amount of requests clients make, they can use the 429 Too Many Requests status code to inform the client that they’ve exceeded it. For example, perhaps an API wants to limit users to 100 HTTP requests per hour. It’s possible to tell a client when they can make requests again …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday June 4, 2019


428 Precondition Required

To avoid multiple users writing to the same resources and overwriting each others changes, its useful to take advantage of conditional requests, using the If-Match , If-None-Match , If-Modified-Since and If-Unmodified-Since headers. These headers are opt-in though. If a server wants to force a client to …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday May 28, 2019


426 Upgrade Required

The 426 Upgrade Required status code is used when a server wants to tell a client that they should be using a newer version or different protocol to talk to the server. Example HTTP/1.1 426 Upgrade Required Upgrade: HTTP/3 Connection: Upgrade To use this service, you must use HTTP version 3. Usage …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday May 21, 2019


425 Too Early

When a HTTP client makes a connection to a HTTPS server, it uses TLS to create a secure connection. TLS can have a bit of a complicated ‘handshake’ to establish the connection. Because there’s a bunch of back and forward, this can take a long time, especially when there’s a lot of latency between server and client. …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday May 14, 2019


424 Failed Dependency

The 424 Failed Dependency status-code does not appear in the base HTTP specification, but is part of WebDAV specification , which is an extension to HTTP. WebDAV has a concept of ‘properties’ that are associated with resources. They are a little bit like extended file attributes , which is a feature on many …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday May 7, 2019


423 Locked

The 423 Locked status-code does not appear in the base HTTP specification, but is part of WebDAV specification , which is an extension to HTTP. A major goal of WebDAV was to provide a ‘filesystem over the web’. One of its core features is for users to ‘lock’ specific files and directories to prevent others …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday April 30, 2019


422 Unprocessable Entity

The 422 Unprocessable Entity status-code does not appear in the base HTTP specification. Like 102 and 207 it’s part of the WebDAV specification , which is an extension to HTTP. Unlike the other two, the 422 code has a good general use-case, and is often used in Web API’s. The 422 code implies that …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday April 23, 2019


421 Misdirected Request

A server should emit 421 Misdirected Request when it receives a HTTP request that was not intended for that server. This status was introduced with HTTP/2, but it may also be applicable to HTTP/1 servers. For example, a server might receive the following HTTP request: GET /contact.html HTTP/1.1 Host: …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday April 16, 2019


420 Enhance your calm

The 420 Enhance Your Calm status code is an unofficial extension by Twitter. Twitter used this to tell HTTP clients that they were being rate limited. Rate limiting means putting restrictions on the total number of requests a client may do within a time period. For Twitter it was useful enough to extend the …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday April 9, 2019


418 I'm a teapot

The IETF has a tradition to publish one or more april-fools RFC documents every year. Among the most famous are IP over Avian Carriers with Quality of Service , and of course Hyper Text Coffee Pot Control Protocol , which introduced the 418 I'm a teapot HTTP status. This status-code is of course not an …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday April 2, 2019


Using loops instead of higher order functions

I came across a great article from Kirstian Poslek, titled “One reduce() to rule them all” . It explains the reduce() function quite well. I often feel though that using higher order functions are used in many cases where simple loops might be more legible. The article ends with an example of a function that …

Continue reading »

Written by Evert Pot - - Aggregated on Thursday March 28, 2019