Tag Archives: Request header

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") %>