निम्न उदाहरण दर्शाता है कि 407 एरर कोड क्लाइंट ब्राउज़र को कैसे भेजा जाता है। इसके बाद, ब्राउज़र आपको "Need authentication!!!" संदेश दिखाएगा।
<html> <head> <title>Setting HTTP Status Code</title> </head> <body> <% // एरर कोड और कारण सेट करें। response.sendError(407, "Need authentication!!!" ); %> </body> </html>
आपको निम्न आउटपुट प्राप्त होगा -
HTTP Status 407 - Need authentication!!!
type Status report
message Need authentication!!!
description The client must first authenticate itself with the proxy (Need authentication!!!).
Apache Tomcat/5.5.29