Closed yzernik closed 2 years ago
We actually thought about this, but then elected not to do it. If I recall, our thinking was that there isn't any HTTP client software out there that will actually do anything useful in response to a 402. In particular, there isn't any software that will prompt the user to pay in response to a 402, and no way to deliver along with a 402 instructions for how to make the payment. In addition, some software, like HTTP clients, might misbehave if they get an unexpected status code. I'd definitely be open for returning 402s if it actually did something useful, but at the moment I don't think it's a benefit.
That makes sense.
In the future, it might be worth revisiting if the WebLN spec or browser extensions like Joule standardize 402 error handling.
Use status code 402 when a file requires payment.
From Mozilla: