org.milyn.useragent.request
Interface HttpRequest

All Superinterfaces:
Request
All Known Implementing Classes:
MockHttpRequest

public interface HttpRequest
extends Request

Http interface definition.

Definition of access to the HTTP request attributes - namely the request headers and parameters.

Method signatures are based on the servlet spec HttpServletRequest class.

Author:
Tom Fennelly

Method Summary
 String getHeader(String name)
          Get the named HTTP request header.
 String getParameter(String name)
          Get the named HTTP request parameter from the request query string.
 Enumeration getParameterNames()
          Returns an Enumeration of String objects containing the names of the parameters contained in this request.
 String[] getParameterValues(String name)
          Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
 

Method Detail

getHeader

String getHeader(String name)
Get the named HTTP request header.

Parameters:
name - The request header name.
Returns:
The value of the header with the specified name, or null if the header isn't present in the request.

getParameter

String getParameter(String name)
Get the named HTTP request parameter from the request query string.

Parameters:
name - The name of the required request parameter.
Returns:
The value of the request parameter, or null if the parameter isn't present in the request.

getParameterNames

Enumeration getParameterNames()
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.

Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters.

getParameterValues

String[] getParameterValues(String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.

Parameters:
name - String containing the name of the parameter whose value is requested.
Returns:
an array of String objects containing the parameter's values.


Copyright © 2018. All rights reserved.