Class HTTPAbstractImpl

    • Constructor Detail

      • HTTPAbstractImpl

        protected HTTPAbstractImpl​(HTTPSamplerBase testElement)
    • Method Detail

      • sample

        protected abstract HTTPSampleResult sample​(URL url,
                                                   String method,
                                                   boolean areFollowingRedirect,
                                                   int frameDepth)
      • threadFinished

        protected void threadFinished()
      • notifyFirstSampleAfterLoopRestart

        protected void notifyFirstSampleAfterLoopRestart()
      • getHTTPFiles

        protected HTTPFileArg[] getHTTPFiles()
        Get the collection of files as a list. The list is built up from the filename/filefield/mimetype properties, plus any additional entries saved in the FILE_ARGS property.

        If there are no valid file entries, then an empty list is returned.

        Invokes HTTPSamplerBase.getHTTPFiles()

        Returns:
        an array of file arguments (never null)
      • getSendFileAsPostBody

        protected boolean getSendFileAsPostBody()
        Determine whether to send a file as the entire body of an entity enclosing request such as POST, PUT or PATCH. Invokes HTTPSamplerBase.getSendFileAsPostBody()
        Returns:
        flag whether to send a file as POST, PUT or PATCH
      • getSendParameterValuesAsPostBody

        protected boolean getSendParameterValuesAsPostBody()
        Determine whether to send concatenated parameters as the entire body of an entity enclosing request such as POST, PUT or PATCH. Invokes HTTPSamplerBase.getSendParameterValuesAsPostBody()
        Returns:
        flag whether to send concatenated parameters as the entire body
      • getUseMultipartForPost

        protected boolean getUseMultipartForPost()
        Determine if we should use multipart/form-data or application/x-www-form-urlencoded for the post

        Invokes HTTPSamplerBase.getUseMultipartForPost()

        Returns:
        true if multipart/form-data should be used and method is POST
      • isSuccessCode

        protected boolean isSuccessCode​(int errorLevel)
        Determine if the HTTP status code is successful or not i.e. in range 200 to 399 inclusive

        Invokes HTTPSamplerBase.isSuccessCode(int)

        Parameters:
        errorLevel - status code to check
        Returns:
        whether in range 200-399 or not
      • readResponse

        protected byte[] readResponse​(SampleResult res,
                                      InputStream instream,
                                      int responseContentLength)
                               throws IOException
        Read response from the input stream, converting to MD5 digest if the useMD5 property is set.

        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, int)

        Parameters:
        res - sample to store information about the response into
        instream - input stream from which to read the response
        responseContentLength - expected input length or zero
        Returns:
        the response or the MD5 of the response
        Throws:
        IOException - if reading the result fails
      • readResponse

        protected byte[] readResponse​(SampleResult res,
                                      BufferedInputStream in,
                                      int contentLength)
                               throws IOException
        Read response from the input stream, converting to MD5 digest if the useMD5 property is set.

        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, int)

        Parameters:
        res - sample to store information about the response into
        in - input stream from which to read the response
        contentLength - expected input length or zero
        Returns:
        the response or the MD5 of the response
        Throws:
        IOException - when reading the result fails
      • resultProcessing

        protected HTTPSampleResult resultProcessing​(boolean areFollowingRedirect,
                                                    int frameDepth,
                                                    HTTPSampleResult res)
        Follow redirects and download page resources if appropriate. this works, but the container stuff here is what's doing it. followRedirects() is actually doing the work to make sure we have only one container to make this work more naturally, I think this method - sample() - needs to take an HTTPSamplerResult container parameter instead of a boolean:areFollowingRedirect.

        Invokes HTTPSamplerBase.resultProcessing(boolean, int, HTTPSampleResult)

        Parameters:
        areFollowingRedirect - flag whether we are getting a redirect target
        frameDepth - Depth of this target in the frame structure. Used only to prevent infinite recursion.
        res - sample result to process
        Returns:
        the sample result
      • notifySSLContextWasReset

        protected void notifySSLContextWasReset()
        Called by testIterationStart if the SSL Context was reset. This implementation does nothing.