PHPNews

Better typing with Ketting

Ketting is a generic hypermedia client that supports HAL, HTML, JSON-API, and HTTP Links (and soon also Siren ). Version 5 is currently in development, and one of the major new features is much deeper support for Typescript typing. Here’s how it works. Normally to get to a resource, you start with a …

Continue reading »

Written by Evert Pot - - Aggregated on Monday October 21, 2019


Structured headers NPM package: new version

I just updated my structured-headers package to be up to date with the latest verison of the Structured headers IETF draft. If you do anything with HTTP, structured headers might be something you have to deal with in the future. Many HTTP headers encode complex values, and many HTTP headers have their …

Continue reading »

Written by Evert Pot - - Aggregated on Friday October 4, 2019


Authentication relation types

When you’re building Hypermedia-style services, you might have used the IANA link relation types list to find appropriate, generic keywords for your rel="" attributes. This list is the official registry for relation types such as collection , next , canonical and others. I had a need for adding a few …

Continue reading »

Written by Evert Pot - - Aggregated on Wednesday October 2, 2019


Typescript definitions for HAL and Link Hints

I’ve been working a lot with HAL and lately also the link hints draft , and I found myself writing the typescript definitions for them one time too many. So yesterday I published a tiny NPM package, so I could do it once and never again. Github project . npmjs.com package . Because there’s …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday October 1, 2019


The end of the HTTP series

Last year I quit my job at Yelp, and wanted to be a more active blogger again. I thought it would be a neat idea to write 1 post per week, one for each HTTP status. This was quite an undertaking, and I ended up having to write 67 blog posts, one each week. Some stats: 67 HTTP statuses. 70 blog …

Continue reading »

Written by Evert Pot - - Aggregated on Wednesday September 18, 2019


511 Network Authentication Required

511 Network Authentication Required is a status that can be used by for example captive portals to signal to computers that they need to go through some kind of sign-in after connecting to a WiFi network. You might see these kind of sign-in screens when for example connecting to the WiFi at a coffee shop. Most …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday September 10, 2019


510 Not Extended

RFC2774 is an experimental RFC, that introduces a mechanism to allow developers to extend the HTTP protocol with vendor-specific features in a safe namespaced way. Around this time many new protocols and systems started to get built on top of HTTP, and the authors might have felt there was a need to do this in …

Continue reading »

Written by Evert Pot - - Aggregated on Thursday September 5, 2019


508 Loop Detected

508 Loop Detected is a status code that’s introduced by an extension of the WebDAV specification . The specific extension adds support for a ‘Binding’ feature. WebDAV itself is a bit like a filesystem protocol over HTTP, and the Binding extension adds support for a ‘hardlink’-like feature via the BIND and …

Continue reading »

Written by Evert Pot - - Aggregated on Friday August 30, 2019


507 Insufficient Storage

507 Insufficient Storage is a status code that’s introduced by the WebDAV , specification. It allows a HTTP server to tell a client that for example their PUT or POST operation couldn’t succeed, maybe because it’s too large to fit on a disk. Even though it was written for WebDAV, it can be used outside of …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday August 20, 2019


506 Variant Also Negotiates

In 1998 RFC2295 was published. It’s experimental, and meant to introduce a new way to do content negotiation in HTTP. As far as I personally know, I don’t think it got a lot of traction. Traditionally, when a HTTP client wants to do content-negotation, they will send one or more accept headers: GET / …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday August 13, 2019


505 HTTP Version Not Supported

505 HTTP Version Not Supported is a status that a server can emit if it doesn’t support the major HTTP version the client used to make the request. To test this, I opened a telnet connection to a couple of major websites, and wrote the following: GET / HTTP/4.0 A few sites returned a 400 Bad Request , …

Continue reading »

Written by Evert Pot - - Aggregated on Tuesday August 6, 2019


504 Gateway Timeout

504 Gateway Timeout is a status a proxy might emit, when it’s acting as a proxy and not getting a response from an upstream server. This is fairly close to 502 Bad Gateway , except that 502 should be returned when a proxy got an invalid response, and 504 typically when the proxy didn’t get a response at all …

Continue reading »

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


503 Service Unavailable

503 Service Unavailable is a status that a server can send when it is overloaded, or otherwise incapable of handling a request. Maybe the server is just bootin gup, or perhaps the application is partially down. When this status is returned, a server can optionally include a Retry-After header to tell a client …

Continue reading »

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


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