Class HttpRequestHdr
-
- All Implemented Interfaces:
public class HttpRequestHdrThe headers of the client HTTP request.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringCONTENT_TYPEpublic final static StringCONTENT_LENGTHpublic Stringmethodpublic Stringurlpublic Array<byte>rawPostDatapublic final StringhttpSamplerNamepublic HeaderManagerheaderManagerpublic StringfirstLinepublic final Stringprefixpublic final inthttpSampleNameModepublic final StringhttpSampleNameFormat
-
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 StringgetMethod()Returns the method string extracted from the first line of the client request. StringgetUrl()Returns the url string extracted from the first line of the client request. Array<byte>getRawPostData()StringgetHttpSamplerName()HeaderManagergetHeaderManager()StringgetFirstLine()StringgetPrefix()intgetHttpSampleNameMode()StringgetHttpSampleNameFormat()booleanisDetectGraphQLRequest()Return true if automatic GraphQL Request detection is enabled. Array<byte>parse(InputStream in)Parses a http header from a stream. StringgetContentType()MultipartUrlConfiggetMultipartConfig(String contentType)StringserverName()Find the //server.name from an url. intserverPort()Find the :PORT from http://server.ect:PORT/some/file. StringgetPath()Find the /some/file.xxxx from http://server.ect:PORT/some/file. StringgetUrlWithoutQuery(URL url)StringgetProtocol(HTTPSamplerBase sampler)voidsetDetectGraphQLRequest(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
-
-
-
-