Difference between HTTP Response Status Code 402 and 403

Friends and other users,

We have 402 and 403 http response codes. Although, 402 is reserved for future use.

What is (or will be) the difference between the two. Payment not received should be equal to unauthorized, right?

EDIT: I would like to know the answers to the question "Why is 402 required when we already have a 403 angle."

+6
source share
3 answers

403 Forbidden

The server understood the request, but refuses to fulfill it. Authorization will not help, and the request MUST NOT be repeated. If the request method was not HEAD and the server wants to report why the request was not executed, it MUST describe the reason for the failure in essence. If the server does not want to provide this information to the client, a 404 (Not Found) status code can be used instead.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

That is, this help?

+5
source

The 402 HTTP status code is really different from 403:

As he states in RFC 2616 , status code 402 is

402 Payment Required 

This means that the request is usually denied, but requires payment.

There seems to be some work that is used to use this reserved status code.

I think that it is not needed at present (or simply not used, because it is not indicated how to use it), but the authors of the standard thought about putting it in the future, which could be useful.

+8
source

Please note that the lack of payment is just one reason why your server rejects the request. You may receive a “forbidden” status in other situations, such as invalid credentials, an attempt to access a “private resource”, etc.

I believe 402, just to give more details about the reason for the denial of the request.

0
source

All Articles