407 Proxy Authentication Required is an error a HTTP proxy returns if
it requires authentication. It’s really similar to 401 Unauthorized .
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic; realm="Secured area"
As you can see above, the response looks pretty similar to 401 …
If you’re integrating your Node.js service with MySQL, you probably want to
I’ve seen a fair bit of ugly code to do this, often using callbacks. I thought
I would share some of my own patterns here. Maybe this is useful to others
I don’t typically use ORM’s. If you’re already happy with …
Happy 2019! After a small hiatus we’re back with this captivating series. I
hope you’re as excited as I am and I hope you have the best 2019!
406 Not Acceptable is emitted by a server when the client asked for a
specific representation of a resource that the server doesn’t support.
HTTP has …
In 2017 the company I worked for in Toronto got acquired by Yelp. The
software engineers in my company (including myself) were asked to move to San
Francisco. At the end of 2017 we moved, and I spent most of 2018 there.
With the year coming to an end, I thought it might be a good time to reflect
on my time there.
405 Method Not Allowed should be returned by a server when a certain
HTTP method is not supported at a resource.
It’s a bit different from 403 Forbidden . 403 suggest that the server
might support the HTTP request, but the client doesn’t have the right
privileges to do the HTTP request.
405 Method Not …
404 Not Found hardly needs an introduction. It’s by far the most seen
status by developers and non-developers alike. 404 is emitted when a
resource doesn’t exist, never existed or if the server doesn’t want a client
to know that a resource exist.
If the server knows the resource doesn’t and will never exist …
A very common and oft-repeated programmer’s wisdom is “Don’t use floats for
currency”. This always made a lot of sense to me. The idea is that floats are
imprecise, due to the way they are stored.
Effectively floats are stored not by just their digits, but by a formula .
This formula can’t accurately represent …
403 Forbidden should be used when a client is trying to do a request
it’s not allowed to do for a variety of reasons. Maybe the user doesn’t have
the right permissions, or maybe it’s logged in with the wrong credentials.
It’s a good generic status code for anything that’s “not allowed” for a
variety of reasons, …
My current job involves a lot of spreadsheets and financial data. Like my last
few jobs, I’m still mainly building REST API’s, but some of them now use
text/csv and Link: headers instead of HAL!
Anyway, I had trouble finding a simple CLI-based tool to browser .csv files,
and was reminded of an MS-DOS …
402 Payment Required is a status-code described by the standard as:
The 402 (Payment Required) status code is reserved for future use.
The original idea may have been that commercial websites and APIs would want
to have a default way to communicate that a HTTP request can be repeated,
after a user paid …
When a client makes a HTTP request, but the server requires the request to
be authenticated a 401 Unauthorized status is returned.
This could mean that a user needs to log in first, or more generally that
authentication credentials are required. It could also mean that the provided
credentials were incorrect. …
400 Bad Request is the first error code. Every status that starts with a
4 indicates that the client did something wrong. If the status starts with a
5 it means that the server did something wrong.
400 Bad Request is used as a generic error code. It’s a useful default error
code if there’s no specific error …
The 3xx status-codes are a bit of a mess. There’s a lot of confusion and
mis-use, so I thought it might help to sum all of them up in a single article.
Choosing the right redirect
Are you responding to a POST request, and instead of returning a status
immediately, you want to redirect the user to a confirmat…
308 Permanent Redirect is similar to 301 Moved Permanently .
Both indicate that the resource the user tried to access has moved to a new
location. In both cases the client should update any bookmarks they had from
the old to the new location. Search engines respect these statuses too.
The difference between …
307 Temporary Redirect is similar to 302 Found in that it
tells a client to temporarily redirect to a different location to access the
The difference from 302 is that with a 307 , the
client must follow the location and issue the exact same request again. So
if it did a POST request on …
The HTTP specifications, starting from RFC2616 have a gap between
the 305 and 307 status codes.
The specification states:
The 306 status code was defined in a previous version of this
specification, is no longer used, and the code is reserved.
Naturally I was curious what it used to be, so I …
305 Use Proxy is a deprecated status code. Using the status-code a
server could instruct a client that it should connect to a proxy, and repeat
that same request there.
305 kind of works like a redirect. It really tells a client: this resource
can only be fetched if you used the right proxy. Presumably a client …
I last blogged about this project in June , so I thought it was worth
listing the most interesting recent changes.
Content-Type and Accept header improvements
In the past, the Ketting library used a configurable set of mime-types for …
304 Not Modified is used in response to a conditional GET or HEAD
request. A request can be made condtional with one of the following headers:
If-Modified-Since and If-None-Match are used specifically …