org.apache.jmeter.protocol.http.proxy

## Class HttpRequestHdr

- java.lang.Object
- - org.apache.jmeter.protocol.http.proxy.HttpRequestHdr

-     public class HttpRequestHdr
      extends java.lang.Object

  The headers of the client HTTP request.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CONTENT_LENGTH`
    `static java.lang.String` | `CONTENT_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpRequestHdr()`
    `HttpRequestHdr(java.lang.String httpSamplerName)`
    `HttpRequestHdr(java.lang.String prefix, java.lang.String httpSamplerName)`
    `HttpRequestHdr(java.lang.String prefix, java.lang.String httpSamplerName, int httpSampleNameMode)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getContentType()`
    `java.lang.String` | `getFirstLine()`
    `HeaderManager` | `getHeaderManager()`
    `int` | `getHttpSampleNameMode()`
    `java.lang.String` | `getHttpSamplerName()`
    `java.lang.String` | `getMethod()` Returns the method string extracted from the first line of the client request.
    `MultipartUrlConfig` | `getMultipartConfig(java.lang.String contentType)`
    `java.lang.String` | `getPath()` Find the /some/file.xxxx from http://server.ect:PORT/some/file.xxx
    `java.lang.String` | `getPrefix()`
    `java.lang.String` | `getProtocol(HTTPSamplerBase sampler)`
    `byte[]` | `getRawPostData()`
    `java.lang.String` | `getUrl()` Returns the url string extracted from the first line of the client request.
    `java.lang.String` | `getUrlWithoutQuery(java.net.URL _url)`
    `byte[]` | `parse(java.io.InputStream in)` Parses a http header from a stream.
    `java.lang.String` | `serverName()` Find the //server.name from an url.
    `int` | `serverPort()` Find the :PORT from http://server.ect:PORT/some/file.xxx

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CONTENT_TYPE

          public static final java.lang.String CONTENT_TYPE

      See Also:
        Constant Field Values

    - #### CONTENT_LENGTH

          public static final java.lang.String CONTENT_LENGTH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HttpRequestHdr

          public HttpRequestHdr()

    - #### HttpRequestHdr

          public HttpRequestHdr(java.lang.String httpSamplerName)

      Parameters:
        `httpSamplerName` - the http sampler name

    - #### HttpRequestHdr

          public HttpRequestHdr(java.lang.String prefix,
                                java.lang.String httpSamplerName)

      Parameters:
        `prefix` - Sampler prefix
        `httpSamplerName` - the http sampler name

    - #### HttpRequestHdr

          public HttpRequestHdr(java.lang.String prefix,
                                java.lang.String httpSamplerName,
                                int httpSampleNameMode)

      Parameters:
        `prefix` - Sampler prefix
        `httpSamplerName` - the http sampler name
        `httpSampleNameMode` - the naming mode of sampler name

  - ### Method Detail

    - #### parse

          public byte[] parse(java.io.InputStream in)
                       throws java.io.IOException

      Parses a http header from a stream.
      Parameters:
        `in` - the stream to parse.
      Returns:
        array of bytes from client.
      Throws:
        `java.io.IOException` - when reading the input stream fails

    - #### getHeaderManager

          public HeaderManager getHeaderManager()

    - #### getContentType

          public java.lang.String getContentType()

    - #### getMultipartConfig

          public MultipartUrlConfig getMultipartConfig(java.lang.String contentType)

    - #### serverName

          public java.lang.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 java.lang.String getPath()

      Find the /some/file.xxxx from http://server.ect:PORT/some/file.xxx
      Returns:
        the path

    - #### getUrl

          public java.lang.String getUrl()

      Returns the url string extracted from the first line of the client request.
      Returns:
        the url

    - #### getMethod

          public java.lang.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 java.lang.String getFirstLine()

    - #### getUrlWithoutQuery

          public java.lang.String getUrlWithoutQuery(java.net.URL _url)

    - #### getHttpSamplerName

          public java.lang.String getHttpSamplerName()

      Returns:
        the httpSamplerName

    - #### getRawPostData

          public byte[] getRawPostData()

      Returns:
        byte[] Raw post data

    - #### getProtocol

          public java.lang.String getProtocol(HTTPSamplerBase sampler)

      Parameters:
        `sampler` - `HTTPSamplerBase`
      Returns:
        String Protocol (http or https)

    - #### getPrefix

          public java.lang.String getPrefix()

      Returns:
        the prefix

    - #### getHttpSampleNameMode

          public int getHttpSampleNameMode()

      Returns:
        the httpSampleNameMode

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.