java.lang.Object
com.orientechnologies.orient.server.network.protocol.http.OHttpRequestWrapper

public class OHttpRequestWrapper extends Object
Wrapper to use the HTTP request in functions and scripts. This class mimics the J2EE HTTPRequest class.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Constructor Details

    • OHttpRequestWrapper

      public OHttpRequestWrapper(OHttpRequest iRequest)
    • OHttpRequestWrapper

      public OHttpRequestWrapper(OHttpRequest iRequest, String[] iArgs)
  • Method Details

    • getContent

      public String getContent()
      Returns the request's content.
      Returns:
      The content in form of String
    • getUser

      public String getUser()
      Gets the request's user name.
      Returns:
      The user name in form of String
    • getContentType

      public String getContentType()
      Returns the request's content type.
      Returns:
      The content type in form of String
    • getHttpVersion

      public String getHttpVersion()
      Return the request's HTTP version.
      Returns:
      The HTTP method version in form of String
    • getHttpMethod

      public String getHttpMethod()
      Return the request's HTTP method called.
      Returns:
      The HTTP method name in form of String
    • getHeaders

      public Map<String,String> getHeaders()
      Return the request's HTTP headers
      Returns:
      The HTTP request headers in the form of a map
    • getIfMatch

      public String getIfMatch()
      Return the request's IF-MATCH header.
      Returns:
      The if-match header in form of String
    • isMultipart

      public boolean isMultipart()
      Returns if the requests has multipart.
      Returns:
      true if is multipart, otherwise false
    • getArguments

      public String[] getArguments()
      Returns the call's argument passed in REST form. Example: /2012/10/26
      Returns:
      Array of arguments
    • getArgument

      public String getArgument(int iPosition)
      Returns the argument by position
      Returns:
      Array of arguments
    • getParameters

      public Map<String,String> getParameters()
      Returns the request's parameters.
      Returns:
      The parameters as a Map<String,String>
    • getParameter

      public String getParameter(String iName)
      Returns the request's parameter.
      Returns:
      The parameter value if any otherwise null
    • hasParameters

      public int hasParameters(String... iNames)
      Checks how many parameters have been received.
      Returns:
      The number of parameters found between the passed ones
    • getSessionId

      public String getSessionId()
      Returns the session-id.
      Returns:
      The session-id in form of String
    • getURL

      public String getURL()
      Returns the request's URL.
      Returns:
      The URL requested in form of String
    • getRemoteAddress

      public String getRemoteAddress()