নিচের উদাহরণ দেখায় কীভাবে একটি ৪০৭ এরর কোড ক্লায়েন্ট ব্রাউজারের কাছে পাঠানো হয়। এরপর ব্রাউজার আপনাকে "Need authentication!!!" মেসেজ দেখাবে।
<html> <head> <title>Setting HTTP Status Code</title> </head> <body> <% // Set error code and reason. 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