Class HTTPSampler

All Implemented Interfaces:
Serializable, Cloneable, ConfigMergabilityIndicator, Replaceable, Searchable, HTTPConstantsInterface, Interruptible, Sampler, org.apache.jmeter.testelement.TestElement, TestIterationListener, TestStateListener, ThreadListener
Direct Known Subclasses:

public class HTTPSampler extends HTTPSamplerBase implements Interruptible
A sampler which understands all the parts necessary to read statistics about HTTP requests, including cookies and authentication. This sampler uses the default Java HTTP implementation
See Also:
  • Constructor Details

    • HTTPSampler

      public HTTPSampler()
  • Method Details

    • interrupt

      public boolean interrupt()
      Description copied from interface: Interruptible
      Interrupt the current operation if possible.
      Specified by:
      interrupt in interface Interruptible
      true if there was an operation to interrupt.
    • sample

      protected HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth)
      Description copied from class: HTTPSamplerBase
      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.

      Specified by:
      sample in class HTTPSamplerBase
      u - URL to sample
      method - HTTP method: GET, POST,...
      areFollowingRedirect - whether we're getting a redirect target
      depth - Depth of this target in the frame structure. Used only to prevent infinite recursion.
      results of the sampling, can be null if u is in CacheManager