Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message body on a 404 message

Tags:

I was talking with a co-worker that for some reason wrote a framework from the ground up just because it wasn't able to automatically unmarshall a message body on a 404 HTTP Packet.

He says that he's following REST principles. My guess is that a message body on a 404 HTTP Packet violate those principles, but I'm not sure of it.

If someone has a opinion regarding this, please answer :)

like image 530
Paulo Victor Avatar asked Feb 09 '11 02:02

Paulo Victor


People also ask

Can a 404 response have a body?

If you use a web browser to go to http://www.google.com/unknown You will get a 404 status code and an entity body. It is quite common for entity bodies to be returned with 404s.

What is the error message for 404?

The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to link rot.


1 Answers

If you use a web browser to go to http://www.google.com/unknown You will get a 404 status code and an entity body.

It is quite common for entity bodies to be returned with 404s.

If you look at the description of 400 errors in the HTTPbis spec you will see

the server SHOULD include a representation containing an
explanation of the error situation, and whether it is a temporary or
permanent condition.

like image 162
Darrel Miller Avatar answered Sep 30 '22 03:09

Darrel Miller