public abstract class HTTPAbstractImpl extends Object implements Interruptible, HTTPConstantsInterface
Modifier and Type | Field and Description |
---|---|
protected static boolean |
ADD_CONTENT_TYPE_TO_POST_IF_MISSING
Should we add to POST request content-type header if missing:
Content-Type: application/x-www-form-urlencoded
|
protected static Predicate<String> |
ALL_EXCEPT_COOKIE |
protected static Predicate<String> |
ONLY_COOKIE |
protected HTTPSamplerBase |
testElement |
APPLICATION_X_WWW_FORM_URLENCODED, CACHE_CONTROL, CONNECT, CONNECTION_CLOSE, COPY, DATE, DEFAULT_HTTP_PORT, DEFAULT_HTTP_PORT_STRING, DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_PORT_STRING, DELETE, ENCODING_BROTLI, ENCODING_DEFLATE, ENCODING_GZIP, ETAG, EXPIRES, GET, HEAD, HEADER_AUTHORIZATION, HEADER_CONNECTION, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, HEADER_COOKIE_IN_REQUEST, HEADER_HOST, HEADER_LOCAL_ADDRESS, HEADER_LOCATION, HEADER_SET_COOKIE, HTTP_1_1, IF_MODIFIED_SINCE, IF_NONE_MATCH, KEEP_ALIVE, LAST_MODIFIED, LOCK, MKCALENDAR, MKCOL, MOVE, MULTIPART_FORM_DATA, OPTIONS, PATCH, POST, PROPFIND, PROPPATCH, PROTOCOL_HTTP, PROTOCOL_HTTPS, PUT, REPORT, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_SEE_OTHER, SC_TEMPORARY_REDIRECT, SEARCH, TRACE, TRANSFER_ENCODING, UNLOCK, VARY
Modifier | Constructor and Description |
---|---|
protected |
HTTPAbstractImpl(HTTPSamplerBase testElement) |
Modifier and Type | Method and Description |
---|---|
protected void |
configureSampleLabel(SampleResult res,
URL url) |
protected HTTPSampleResult |
errorResult(Throwable t,
HTTPSampleResult res)
Populates the provided HTTPSampleResult with details from the Exception.
|
protected Arguments |
getArguments()
Invokes
HTTPSamplerBase.getArguments() |
protected AuthManager |
getAuthManager()
Invokes
HTTPSamplerBase.getAuthManager() |
protected boolean |
getAutoRedirects()
|
protected CacheManager |
getCacheManager()
|
protected int |
getConnectTimeout()
|
protected String |
getContentEncoding()
|
protected CookieManager |
getCookieManager()
|
protected boolean |
getDoBrowserCompatibleMultipart()
|
protected HeaderManager |
getHeaderManager()
|
protected HTTPFileArg[] |
getHTTPFiles()
Get the collection of files as a list.
|
protected String |
getIpSource()
Invokes
HTTPSamplerBase.getIpSource() |
protected InetAddress |
getIpSourceAddress()
Gets the IP source address (IP spoofing) if one has been provided.
|
protected String |
getProxyHost()
Invokes
HTTPSamplerBase.getProxyHost() |
protected String |
getProxyPass()
Invokes
HTTPSamplerBase.getProxyPass() |
protected int |
getProxyPortInt()
|
protected String |
getProxyScheme()
Invokes
HTTPSamplerBase.getProxyScheme() |
protected String |
getProxyUser()
Invokes
HTTPSamplerBase.getProxyUser() |
protected int |
getResponseTimeout()
|
protected boolean |
getSendFileAsPostBody()
Determine whether to send a file as the entire body of an
entity enclosing request such as POST, PUT or PATCH.
|
protected boolean |
getSendParameterValuesAsPostBody()
Determine whether to send concatenated parameters as the entire body of an
entity enclosing request such as POST, PUT or PATCH.
|
protected boolean |
getUseKeepAlive()
|
protected boolean |
getUseMultipart()
Determine if we should use
multipart/form-data or
application/x-www-form-urlencoded for the method |
protected boolean |
getUseMultipartForPost()
Deprecated.
|
protected boolean |
hasArguments()
Invokes
HTTPSamplerBase.hasArguments() |
protected boolean |
isMonitor()
Deprecated.
since 3.2 always return false
|
protected boolean |
isSuccessCode(int errorLevel)
Determine if the HTTP status code is successful or not i.e.
|
protected void |
notifyFirstSampleAfterLoopRestart() |
protected void |
notifySSLContextWasReset()
Deprecated.
** unused since r1489189. **
|
protected byte[] |
readResponse(SampleResult res,
BufferedInputStream in,
int contentLength)
Deprecated.
|
protected byte[] |
readResponse(SampleResult res,
BufferedInputStream in,
long contentLength)
Read response from the input stream, converting to MD5 digest if the
useMD5 property is set.
|
protected byte[] |
readResponse(SampleResult res,
InputStream instream,
int responseContentLength)
Read response from the input stream, converting to MD5 digest if the
useMD5 property is set.
|
protected byte[] |
readResponse(SampleResult res,
InputStream instream,
long responseContentLength)
Read response from the input stream, converting to MD5 digest if the
useMD5 property is set.
|
protected HTTPSampleResult |
resultProcessing(boolean areFollowingRedirect,
int frameDepth,
HTTPSampleResult res)
Follow redirects and download page resources if appropriate.
|
protected abstract HTTPSampleResult |
sample(URL url,
String method,
boolean areFollowingRedirect,
int frameDepth) |
protected void |
setUseKeepAlive(boolean b)
|
protected void |
threadFinished() |
protected HTTPSampleResult |
updateSampleResultForResourceInCache(HTTPSampleResult res)
Update HTTPSampleResult for a resource in cache
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
interrupt
protected static final boolean ADD_CONTENT_TYPE_TO_POST_IF_MISSING
protected final HTTPSamplerBase testElement
protected HTTPAbstractImpl(HTTPSamplerBase testElement)
protected abstract HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth)
protected void threadFinished()
protected void notifyFirstSampleAfterLoopRestart()
protected HTTPSampleResult errorResult(Throwable t, HTTPSampleResult res)
See HTTPSamplerBase.errorResult(Throwable, HTTPSampleResult)
t
- Exception representing the error.res
- SampleResult to be modifiedprotected Arguments getArguments()
HTTPSamplerBase.getArguments()
protected AuthManager getAuthManager()
HTTPSamplerBase.getAuthManager()
AuthManager
of the associated test elementprotected boolean getAutoRedirects()
protected CacheManager getCacheManager()
CacheManager
of the associated test elementprotected int getConnectTimeout()
protected String getContentEncoding()
protected CookieManager getCookieManager()
CookieManager
of the associated test elementprotected HeaderManager getHeaderManager()
HeaderManager
of the associated test elementprotected HTTPFileArg[] getHTTPFiles()
If there are no valid file entries, then an empty list is returned.
Invokes HTTPSamplerBase.getHTTPFiles()
null
)protected String getIpSource()
HTTPSamplerBase.getIpSource()
protected InetAddress getIpSourceAddress() throws UnknownHostException, SocketException
null
, if none provided or the device address could not be found)UnknownHostException
- if the hostname/ip for getIpSource()
could not be resolved or not interface was found for itSocketException
- if an I/O error occursprotected String getProxyScheme()
HTTPSamplerBase.getProxyScheme()
protected String getProxyHost()
HTTPSamplerBase.getProxyHost()
protected String getProxyPass()
HTTPSamplerBase.getProxyPass()
protected int getProxyPortInt()
protected String getProxyUser()
HTTPSamplerBase.getProxyUser()
protected int getResponseTimeout()
protected boolean getSendFileAsPostBody()
HTTPSamplerBase.getSendFileAsPostBody()
protected boolean getSendParameterValuesAsPostBody()
HTTPSamplerBase.getSendParameterValuesAsPostBody()
protected boolean getUseKeepAlive()
@Deprecated protected boolean getUseMultipartForPost()
getUseMultipart()
multipart/form-data
or
application/x-www-form-urlencoded
for the post
true
if multipart/form-data
should be
used and method is POSTprotected boolean getUseMultipart()
multipart/form-data
or
application/x-www-form-urlencoded
for the method
true
if multipart/form-data
should be usedprotected boolean getDoBrowserCompatibleMultipart()
protected boolean hasArguments()
HTTPSamplerBase.hasArguments()
@Deprecated protected boolean isMonitor()
HTTPSamplerBase.isMonitor()
protected boolean isSuccessCode(int errorLevel)
errorLevel
- status code to checkprotected byte[] readResponse(SampleResult res, InputStream instream, int responseContentLength) throws IOException
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes
HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoinstream
- input stream from which to read the responseresponseContentLength
- expected input length or zeroIOException
- if reading the result failsprotected byte[] readResponse(SampleResult res, InputStream instream, long responseContentLength) throws IOException
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes
HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoinstream
- input stream from which to read the responseresponseContentLength
- expected input length or zeroIOException
- if reading the result fails@Deprecated protected byte[] readResponse(SampleResult res, BufferedInputStream in, int contentLength) throws IOException
readResponse(SampleResult, BufferedInputStream, long)
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoin
- input stream from which to read the responsecontentLength
- expected input length or zeroIOException
- when reading the result failsprotected byte[] readResponse(SampleResult res, BufferedInputStream in, long contentLength) throws IOException
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoin
- input stream from which to read the responsecontentLength
- expected input length or zeroIOException
- when reading the result failsprotected HTTPSampleResult resultProcessing(boolean areFollowingRedirect, int frameDepth, HTTPSampleResult res)
Invokes
HTTPSamplerBase.resultProcessing(boolean, int, HTTPSampleResult)
areFollowingRedirect
- flag whether we are getting a redirect targetframeDepth
- Depth of this target in the frame structure. Used only to
prevent infinite recursion.res
- sample result to processprotected void setUseKeepAlive(boolean b)
b
- flag whether to use keep-alive for requests@Deprecated protected void notifySSLContextWasReset()
protected HTTPSampleResult updateSampleResultForResourceInCache(HTTPSampleResult res)
res
- HTTPSampleResult
protected final void configureSampleLabel(SampleResult res, URL url)
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.