| org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase org.apache.jmeter.protocol.http.sampler.HTTPSampler
All known Subclasses: org.apache.jmeter.protocol.http.sampler.AccessLogSampler,
HTTPSampler | public class HTTPSampler extends HTTPSamplerBase (Code) | | A sampler which understands all the parts necessary to read statistics about
HTTP requests, including cookies and authentication.
|
Constructor Summary | |
public | HTTPSampler() Constructor for the HTTPSampler object. |
HTTPSampler | public HTTPSampler()(Code) | | Constructor for the HTTPSampler object.
Consider using HTTPSamplerFactory.newInstance() instead
|
getResponseHeaders | protected String getResponseHeaders(HttpURLConnection conn)(Code) | | Gets the ResponseHeaders from the URLConnection
Parameters: conn - connection from which the headers are read string containing the headers, one per line |
sample | protected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth)(Code) | | Samples the URL passed in and stores the result in
HTTPSampleResult , following redirects and downloading
page resources as appropriate.
When getting a redirect target, redirects are not followed and resources
are not downloaded. The caller will take care of this.
Parameters: url - URL to sample Parameters: method - HTTP method: GET, POST,... Parameters: areFollowingRedirect - whether we're getting a redirect target Parameters: frameDepth - Depth of this target in the frame structure. Used only toprevent infinite recursion. results of the sampling |
sendPostData | protected String sendPostData(URLConnection connection) throws IOException(Code) | | Send POST data from Entry to the open connection.
This also handles sending data for PUT requests
Parameters: connection - URLConnection where POST data should be sent a String show what was posted. Will not contain actual file upload content exception: IOException - if an I/O exception occurs |
setPostHeaders | protected void setPostHeaders(URLConnection conn) throws IOException(Code) | | Set request headers in preparation to opening a connection.
Parameters: conn - URLConnection to set headers on exception: IOException - if an I/O exception occurs |
setupConnection | protected HttpURLConnection setupConnection(URL u, String method, HTTPSampleResult res) throws IOException(Code) | | Returns an HttpURLConnection fully ready to attempt
connection. This means it sets the request method (GET or POST), headers,
cookies, and authorization for the URL request.
The request infos are saved into the sample result if one is provided.
Parameters: u - URL of the URL request Parameters: method - GET, POST etc Parameters: res - sample result to save request infos to HttpURLConnection ready for .connect exception: IOException - if an I/O Exception occurs |
Methods inherited from org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase | public void addArgument(String name, String value)(Code)(Java Doc) public void addArgument(String name, String value, String metadata)(Code)(Java Doc) public void addEncodedArgument(String name, String value)(Code)(Java Doc) public void addEncodedArgument(String name, String value, String metaData, String contentEncoding)(Code)(Java Doc) public void addEncodedArgument(String name, String value, String metaData)(Code)(Java Doc) public void addNonEncodedArgument(String name, String value, String metadata)(Code)(Java Doc) public void addTestElement(TestElement el)(Code)(Java Doc) public Object clone()(Code)(Java Doc) protected HTTPSampleResult downloadPageResources(HTTPSampleResult res, HTTPSampleResult container, int frameDepth)(Code)(Java Doc) protected static String encodeBackSlashes(String value)(Code)(Java Doc) protected String encodeSpaces(String path)(Code)(Java Doc) protected HTTPSampleResult errorResult(Throwable e, HTTPSampleResult res)(Code)(Java Doc) protected HTTPSampleResult followRedirects(HTTPSampleResult res, int frameDepth)(Code)(Java Doc) public Arguments getArguments()(Code)(Java Doc) public AuthManager getAuthManager()(Code)(Java Doc) public boolean getAutoRedirects()(Code)(Java Doc) public String getClient()(Code)(Java Doc) public String getContentEncoding()(Code)(Java Doc) public CookieManager getCookieManager()(Code)(Java Doc) public static int getDefaultPort(String protocol, int port)(Code)(Java Doc) public boolean getDoMultipartPost()(Code)(Java Doc) public String getDomain()(Code)(Java Doc) public String getEmbeddedUrlRE()(Code)(Java Doc) public String getFileField()(Code)(Java Doc) public String getFilename()(Code)(Java Doc) public boolean getFollowRedirects()(Code)(Java Doc) public HeaderManager getHeaderManager()(Code)(Java Doc) public String getImplementation()(Code)(Java Doc) public String getMethod()(Code)(Java Doc) public String getMimetype()(Code)(Java Doc) public String getMonitor()(Code)(Java Doc) public String getPath()(Code)(Java Doc) public int getPort()(Code)(Java Doc) public String getProtocol()(Code)(Java Doc) public String getQueryString()(Code)(Java Doc) public String getQueryString(String contentEncoding)(Code)(Java Doc) public boolean getSendFileAsPostBody()(Code)(Java Doc) public boolean getSendParameterValuesAsPostBody()(Code)(Java Doc) public URL getUrl() throws MalformedURLException(Code)(Java Doc) public boolean getUseKeepAlive()(Code)(Java Doc) public boolean getUseMultipartForPost()(Code)(Java Doc) public static String[] getValidMethodsAsArray()(Code)(Java Doc) public boolean hasArguments()(Code)(Java Doc) protected boolean hasUploadableFiles()(Code)(Java Doc) public boolean isImageParser()(Code)(Java Doc) public boolean isMonitor()(Code)(Java Doc) public boolean isProtocolDefaultPort()(Code)(Java Doc) public static boolean isSecure(String protocol)(Code)(Java Doc) public static boolean isSecure(URL url)(Code)(Java Doc) protected boolean isSuccessCode(int code)(Code)(Java Doc) public void parseArguments(String queryString, String contentEncoding)(Code)(Java Doc) public void parseArguments(String queryString)(Code)(Java Doc) protected HTTPSampleResult resultProcessing(boolean areFollowingRedirect, int frameDepth, HTTPSampleResult res)(Code)(Java Doc) public SampleResult sample(Entry e)(Code)(Java Doc) public SampleResult sample()(Code)(Java Doc) abstract protected HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth)(Code)(Java Doc) public void setArguments(Arguments value)(Code)(Java Doc) public void setAuthManager(AuthManager value)(Code)(Java Doc) public void setAutoRedirects(boolean value)(Code)(Java Doc) public void setClient(String client)(Code)(Java Doc) public void setContentEncoding(String value)(Code)(Java Doc) public void setCookieManager(CookieManager value)(Code)(Java Doc) public void setDoMultipartPost(boolean value)(Code)(Java Doc) public void setDomain(String value)(Code)(Java Doc) public void setEmbeddedUrlRE(String regex)(Code)(Java Doc) public void setFileField(String value)(Code)(Java Doc) public void setFilename(String value)(Code)(Java Doc) public void setFollowRedirects(boolean value)(Code)(Java Doc) public void setHeaderManager(HeaderManager value)(Code)(Java Doc) public void setImageParser(boolean parseImages)(Code)(Java Doc) public void setImplementation(String value)(Code)(Java Doc) public void setMethod(String value)(Code)(Java Doc) public void setMimetype(String value)(Code)(Java Doc) public void setMonitor(String value)(Code)(Java Doc) public void setMonitor(boolean truth)(Code)(Java Doc) public void setPath(String path)(Code)(Java Doc) public void setPath(String path, String contentEncoding)(Code)(Java Doc) public void setPort(int value)(Code)(Java Doc) public void setProtocol(String value)(Code)(Java Doc) public void setUseKeepAlive(boolean value)(Code)(Java Doc) public void testEnded()(Code)(Java Doc) public void testEnded(String host)(Code)(Java Doc) public void testIterationStart(LoopIterationEvent event)(Code)(Java Doc) public void testStarted()(Code)(Java Doc) public void testStarted(String host)(Code)(Java Doc) public void threadFinished()(Code)(Java Doc) public void threadStarted()(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|