Class HttpRequestHdr


  • public class HttpRequestHdr
    extends Object
    The headers of the client HTTP request.
    • Constructor Detail

      • HttpRequestHdr

        public HttpRequestHdr()
      • HttpRequestHdr

        public HttpRequestHdr​(String httpSamplerName)
        Parameters:
        httpSamplerName - the http sampler name
    • Method Detail

      • parse

        public byte[] parse​(InputStream in)
                     throws IOException
        Parses a http header from a stream.
        Parameters:
        in - the stream to parse.
        Returns:
        array of bytes from client.
        Throws:
        IOException - when reading the input stream fails
      • getContentType

        public String getContentType()
      • serverName

        public String serverName()
        Find the //server.name from an url.
        Returns:
        server's internet name
      • serverPort

        public int serverPort()
        Find the :PORT from http://server.ect:PORT/some/file.xxx
        Returns:
        server's port (or UNSPECIFIED if not found)
      • getPath

        public String getPath()
        Find the /some/file.xxxx from http://server.ect:PORT/some/file.xxx
        Returns:
        the path
      • getUrl

        public String getUrl()
        Returns the url string extracted from the first line of the client request.
        Returns:
        the url
      • getMethod

        public String getMethod()
        Returns the method string extracted from the first line of the client request.
        Returns:
        the method (will always be upper case)
      • getFirstLine

        public String getFirstLine()
      • getUrlWithoutQuery

        public String getUrlWithoutQuery​(URL _url)
      • getHttpSamplerName

        public String getHttpSamplerName()
        Returns:
        the httpSamplerName
      • getRawPostData

        public byte[] getRawPostData()
        Returns:
        byte[] Raw post data