Class HttpRequestHdr
-
- All Implemented Interfaces:
public class HttpRequestHdr
The headers of the client HTTP request.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
CONTENT_TYPE
public final static String
CONTENT_LENGTH
public String
method
public String
url
public Array<byte>
rawPostData
public final String
httpSamplerName
public HeaderManager
headerManager
public String
firstLine
public final String
prefix
public final int
httpSampleNameMode
public final String
httpSampleNameFormat
-
Constructor Summary
Constructors Constructor Description HttpRequestHdr()
HttpRequestHdr(String httpSamplerName)
HttpRequestHdr(String prefix, String httpSamplerName)
HttpRequestHdr(String prefix, String httpSamplerName, int httpSampleNameMode, String format)
-
Method Summary
Modifier and Type Method Description String
getMethod()
Returns the method string extracted from the first line of the client request. String
getUrl()
Returns the url string extracted from the first line of the client request. Array<byte>
getRawPostData()
String
getHttpSamplerName()
HeaderManager
getHeaderManager()
String
getFirstLine()
String
getPrefix()
int
getHttpSampleNameMode()
String
getHttpSampleNameFormat()
boolean
isDetectGraphQLRequest()
Return true if automatic GraphQL Request detection is enabled. Array<byte>
parse(InputStream in)
Parses a http header from a stream. String
getContentType()
MultipartUrlConfig
getMultipartConfig(String contentType)
String
serverName()
Find the //server.name from an url. int
serverPort()
Find the :PORT from http://server.ect:PORT/some/file. String
getPath()
Find the /some/file.xxxx from http://server.ect:PORT/some/file. String
getUrlWithoutQuery(URL url)
String
getProtocol(HTTPSamplerBase sampler)
void
setDetectGraphQLRequest(boolean detectGraphQLRequest)
Sets whether automatic GraphQL Request detection is enabled. -
-
Constructor Detail
-
HttpRequestHdr
HttpRequestHdr()
-
HttpRequestHdr
HttpRequestHdr(String httpSamplerName)
- Parameters:
httpSamplerName
- the http sampler name
-
HttpRequestHdr
HttpRequestHdr(String prefix, String httpSamplerName)
- Parameters:
prefix
- Sampler prefixhttpSamplerName
- the http sampler name
-
-
Method Detail
-
getMethod
String getMethod()
Returns the method string extracted from the first line of the client request.
- Returns:
the method (will always be upper case)
-
getUrl
String getUrl()
Returns the url string extracted from the first line of the client request.
- Returns:
the url
-
getRawPostData
Array<byte> getRawPostData()
- Returns:
byte[] Raw post data
-
getHttpSamplerName
String getHttpSamplerName()
- Returns:
the httpSamplerName
-
getHeaderManager
HeaderManager getHeaderManager()
-
getFirstLine
String getFirstLine()
-
getHttpSampleNameMode
int getHttpSampleNameMode()
- Returns:
the httpSampleNameMode
-
getHttpSampleNameFormat
String getHttpSampleNameFormat()
-
isDetectGraphQLRequest
boolean isDetectGraphQLRequest()
Return true if automatic GraphQL Request detection is enabled.
- Returns:
true if automatic GraphQL Request detection is enabled
-
parse
Array<byte> parse(InputStream in)
Parses a http header from a stream.
- Parameters:
in
- the stream to parse.- Returns:
array of bytes from client.
-
getContentType
String getContentType()
-
getMultipartConfig
MultipartUrlConfig getMultipartConfig(String contentType)
-
serverName
String serverName()
Find the //server.name from an url.
- Returns:
server's internet name
-
serverPort
int serverPort()
Find the :PORT from http://server.ect:PORT/some/file.xxx
- Returns:
server's port (or UNSPECIFIED if not found)
-
getPath
String getPath()
Find the /some/file.xxxx from http://server.ect:PORT/some/file.xxx
- Returns:
the path
-
getUrlWithoutQuery
String getUrlWithoutQuery(URL url)
-
getProtocol
String getProtocol(HTTPSamplerBase sampler)
- Parameters:
sampler
- HTTPSamplerBase- Returns:
String Protocol (http or https)
-
setDetectGraphQLRequest
void setDetectGraphQLRequest(boolean detectGraphQLRequest)
Sets whether automatic GraphQL Request detection is enabled.
- Parameters:
detectGraphQLRequest
- whether automatic GraphQL Request detection is enabled
-
-
-
-