Example HTTP Response
HTTP/1.1 226 IM Used
IM: delta
Delta-Base: "abc123"- Delta encoding applied to response
- Instance manipulation requested via A-IM header
- Bandwidth optimization for large resources
What does this mean?
Here's the diff! Instead of sending the whole thing again, the server is sending just what changed. Efficient and eco-friendly!
Technical Definition
The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
RFC Says
"The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance."
Plain English:
The server applied transformations (Instance Manipulations) to the resource before sending it. Used with delta encoding to send only changes instead of the full resource, saving bandwidth for frequently updated large resources.
Ready-to-use code for returning this HTTP status in your application:
// Express.js
app.get('/example', (req, res) => {
res.status(226).json({
error: 'IM Used',
message: 'Your error message here'
});
});
// Native HTTP
const http = require('http');
http.createServer((req, res) => {
res.writeHead(226, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
error: 'IM Used',
message: 'Your error message here'
}));
}).listen(3000);