HTTPConstantsInterface, Interruptiblepublic class HTTPHC4Impl extends HTTPHCAbstractImpl
| Modifier and Type | Class | Description |
|---|---|---|
static class |
HTTPHC4Impl.HttpDelete |
testElementAPPLICATION_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_GZIP, ETAG, EXPIRES, GET, HEAD, HEADER_AUTHORIZATION, HEADER_CONNECTION, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, 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, TRACE, TRANSFER_ENCODING, UNLOCKCPS_HTTP, CPS_HTTPS, HTTP_VERSION, localAddress, localHost, NONPROXY_HOSTS, nonProxyHostFull, nonProxyHostSuffix, nonProxyHostSuffixSize, PROXY_DEFINED, PROXY_DOMAIN, PROXY_HOST, PROXY_PASS, PROXY_PORT, PROXY_USER, SO_TIMEOUT, USE_CACHED_SSL_CONTEXT, USE_LOOPBACK| Modifier | Constructor | Description |
|---|---|---|
protected |
HTTPHC4Impl(HTTPSamplerBase testElement) |
| Modifier and Type | Method | Description |
|---|---|---|
protected HTTPSampleResult |
createSampleResult(URL url,
String method) |
Create HTTPSampleResult filling url, method and SampleLabel.
|
protected String |
getCharsetWithDefault(HttpParams putParams) |
If contentEncoding is not set by user, then Platform encoding will be used to convert to String
|
protected void |
handleMethod(String method,
HTTPSampleResult result,
HttpRequestBase httpRequest,
HttpContext localContext) |
Calls
#sendPostData(HttpPost) if method is POST and
#sendEntityData(HttpEntityEnclosingRequestBase) if method is
PUT or PATCH |
boolean |
interrupt() |
Interrupt the current operation if possible.
|
protected void |
notifyFirstSampleAfterLoopRestart() |
|
protected HTTPSampleResult |
sample(URL url,
String method,
boolean areFollowingRedirect,
int frameDepth) |
|
protected String |
sendEntityData(HttpEntityEnclosingRequestBase entity) |
Creates the entity data to be sent.
|
protected String |
sendPostData(HttpPost post) |
|
protected String |
setConnectionCookie(HttpRequest request,
URL url,
CookieManager cookieManager) |
Extracts all the required cookies for that particular URL request and
sets them in the
HttpMethod passed in. |
protected void |
setConnectionHeaders(HttpRequestBase request,
URL url,
HeaderManager headerManager,
CacheManager cacheManager) |
Extracts all the required non-cookie headers for that particular URL request and
sets them in the
HttpMethod passed in |
protected void |
setDefaultRequestHeaders(HttpRequest request) |
Set any default request headers to include
|
protected void |
setupRequest(URL url,
HttpRequestBase httpRequest,
HTTPSampleResult res) |
Setup following elements on httpRequest:
ConnRoutePNames.LOCAL_ADDRESS enabling IP-SPOOFING
Socket and connection timeout
Redirect handling
Keep Alive header or Connection Close
Calls setConnectionHeaders to setup headers
Calls setConnectionCookie to setup Cookie
|
protected void |
threadFinished() |
errorResult, getArguments, getAuthManager, getAutoRedirects, getCacheManager, getConnectTimeout, getContentEncoding, getCookieManager, getDoBrowserCompatibleMultipart, getHeaderManager, getHTTPFiles, getIpSource, getIpSourceAddress, getProxyHost, getProxyPass, getProxyPortInt, getProxyUser, getResponseTimeout, getSendFileAsPostBody, getSendParameterValuesAsPostBody, getUseKeepAlive, getUseMultipartForPost, hasArguments, isMonitor, isSuccessCode, notifySSLContextWasReset, readResponse, readResponse, resultProcessing, setUseKeepAlive, updateSampleResultForResourceInCacheisDynamicProxy, isNonProxy, isNullOrEmptyTrimmed, isPartialMatch, isStaticProxyprotected HTTPHC4Impl(HTTPSamplerBase testElement)
protected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth)
sample in class HTTPAbstractImplprotected void handleMethod(String method, HTTPSampleResult result, HttpRequestBase httpRequest, HttpContext localContext) throws IOException
#sendPostData(HttpPost) if method is POST and
#sendEntityData(HttpEntityEnclosingRequestBase) if method is
PUT or PATCH
Field HTTPSampleResult#queryString of result is modified in the 2 cases
method - String HTTP methodresult - HTTPSampleResulthttpRequest - HttpRequestBaselocalContext - HttpContextIOException - when posting data fails due to I/Oprotected HTTPSampleResult createSampleResult(URL url, String method)
url - URLmethod - HTTP MethodHTTPSampleResultprotected void setupRequest(URL url, HttpRequestBase httpRequest, HTTPSampleResult res) throws IOException
url - URL of the requesthttpRequest - http request for the requestres - sample result to set cookies onIOException - if hostname/ip to use could not be figured outprotected void setDefaultRequestHeaders(HttpRequest request)
request - the HttpRequest to be usedprotected String setConnectionCookie(HttpRequest request, URL url, CookieManager cookieManager)
HttpMethod passed in.request - HttpRequest for the requesturl - URL of the requestcookieManager - the CookieManager containing all the cookiesprotected void setConnectionHeaders(HttpRequestBase request,
URL url,
HeaderManager headerManager,
CacheManager cacheManager)
HttpMethod passed inrequest - HttpRequest which represents the requesturl - URL of the URL requestheaderManager - the HeaderManager containing all the cookies
for this UrlConfigcacheManager - the CacheManager (may be null)protected String sendPostData(HttpPost post) throws IOException
post - HttpPostIOException - if sending the data fails due to I/Oprotected String sendEntityData(HttpEntityEnclosingRequestBase entity) throws IOException
If there is a file entry with a non-empty MIME type we use that to set the request Content-Type header, otherwise we default to whatever header is present from a Header Manager.
If the content charset HTTPAbstractImpl.getContentEncoding() is null or empty
we use the HC4 default provided by HTTP#DEF_CONTENT_CHARSET which is
ISO-8859-1.
entity - to be processed, e.g. PUT or PATCHUnsupportedEncodingException - for invalid charset nameIOException - cannot really occur for ByteArrayOutputStream methodsprotected String getCharsetWithDefault(HttpParams putParams)
putParams - HttpParamsprotected void notifyFirstSampleAfterLoopRestart()
notifyFirstSampleAfterLoopRestart in class HTTPAbstractImplprotected void threadFinished()
threadFinished in class HTTPAbstractImplpublic boolean interrupt()
Interruptibletrue if there was an operation to interrupt.Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.