Getting the Request header



Introduction

The Request Header contains all kinds of useful data, like the requesters method (GET or POST) but also the requester’s browser an OS. This example shows how to get it;

The request method is <%= request.getMethod() %>
The request URI is <%= request.getRequestURI() %>
The request protocol is <%= request.getProtocol() %>
The browser is <%= request.getHeader("user-agent") %>

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.