Utilo

HTTP 226 IM Used – Free, Online, Private

226 IM Used means the response applied an instance manipulation such as a delta.

What HTTP 226 means

226 says the server applied an instance manipulation to produce the body. The historical case is a delta encoding: the client said which instance it already has, and the server sent a diff, and 226 marks that the body is the result of applying that manipulation. It is defined with HTTP delta coding and is rarely seen on ordinary APIs.

226 IM Used belongs to the 2xx successful class. Clients that only look at the class will group it with its neighbors. Clients that care about the exact code should use the narrower rule on this page, because the class is only the first digit.

When you see HTTP 226

When you see HTTP 226 IM Used, stop on that exact status line. 226 IM Used means the response applied an instance manipulation such as a delta. The trace that usually produces it: A client sent A-IM and the server returned a delta under 226. The 2xx successful class only tells you the first digit. A neighbor in that class is a different fault, and the fix on this page does not transfer to it.

Return 226 only if you actually applied an instance manipulation the client asked for. If you sent a normal full representation, return 200. Do not use 226 to mean 'I minified the JSON' or any other private transform. Clients that do not understand the manipulation cannot reconstruct the instance.

How to fix HTTP 226

To fix HTTP 226, change the condition that made the server choose IM Used. Apply the manipulation to the base instance you advertised. If you cannot, do not guess. Request a full representation with a normal GET. A failed delta can be retried, or the client can fall back to a full GET. The GET is safe. Retrying a delta against a base you no longer have is not useful. If the log line is a different code, leave this page. The mix-up people make with 226 is this one: 203 means a proxy transformed a representation and the body is still a representation. 226 means the body is an instance manipulation, not the instance.

  • A proxy did not understand 226 and cached the delta as a full representation.
  • A client applied the delta twice and corrupted the local instance.
  • A server sent 226 with a full body, so the client tried to parse a document as a patch.

An access log that only stores 226 is not enough to tell these apart. Keep the method, the path, and a request id. Do not keep the Authorization header or a request body that might be a token. The status explains the outcome. It is not a place to echo secrets back to the client either.

Example response

HTTP 226 IM UsedHTTP/1.1 226 IM Used
IM: vcdiff
Content-Type: application/vcdiff

IM names the manipulation. The body is not the resource. It is the instructions that produce the resource from an instance the client already has. Applying it to the wrong base instance yields a corrupt result. If you do not implement deltas, you should not send or accept 226.

What the client should do

Apply the manipulation to the base instance you advertised. If you cannot, do not guess. Request a full representation with a normal GET.

Never cache a 226 body as the plain representation of the URL. A cache that does will serve a delta to a client that expects the resource.

A failed delta can be retried, or the client can fall back to a full GET. The GET is safe. Retrying a delta against a base you no longer have is not useful.

Codes people confuse with HTTP 226

203 means a proxy transformed a representation and the body is still a representation. 226 means the body is an instance manipulation, not the instance.

Frequently asked questions

Will I see 226 on a typical JSON API?

No. It is for instance manipulations such as delta coding.

Is the body the resource?

No. The body produces the resource when applied to a base instance.

What should a cache do?

Not store it as the normal representation of the URL.

What if the client does not understand IM?

It should request a full representation instead of parsing the body as the resource.

What should I do first when I see HTTP 226?

Read the status as 226 IM Used specifically. 226 IM Used means the response applied an instance manipulation such as a delta. Then check the cause that matches the request you sent, starting with: A client sent A-IM and the server returned a delta under 226.