Logo Search packages:      
Sourcecode: jakarta-jmeter version File versions  Download package

void org::apache::jmeter::protocol::http::sampler::HTTPSamplerBase::parseArguments ( String  queryString,
String  contentEncoding 
) [inline, inherited]

This method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object.

For each name found, addArgument() is called

queryString - the query string
contentEncoding - the content encoding of the query string. The query string might actually be the post body of a http post request.

Definition at line 956 of file HTTPSamplerBase.java.

References org::apache::jmeter::protocol::http::sampler::HTTPSamplerBase::addEncodedArgument().

Referenced by org::apache::jmeter::protocol::http::sampler::HTTPSamplerBase::setPath(), and org::apache::jmeter::protocol::http::util::accesslog::StandardGenerator::setQueryString().

        String[] args = JOrphanUtils.split(queryString, QRY_SEP);
        for (int i = 0; i < args.length; i++) {
            // need to handle four cases:
            // - string contains name=value
            // - string contains name=
            // - string contains name
            // - empty string

            String metaData; // records the existance of an equal sign
            String name;
            String value;
            int length = args[i].length();
            int endOfNameIndex = args[i].indexOf(ARG_VAL_SEP);
            if (endOfNameIndex != -1) {// is there a separator?
                // case of name=value, name=
                metaData = ARG_VAL_SEP;
                name = args[i].substring(0, endOfNameIndex);
                value = args[i].substring(endOfNameIndex + 1, length);
            } else {
                metaData = "";
            if (name.length() > 0) {
                // If we know the encoding, we can decode the argument value,
                // to make it easier to read for the user
                if(contentEncoding != null) {
                    addEncodedArgument(name, value, metaData, contentEncoding);
                else {
                    // If we do not know the encoding, we just use the encoded value
                    // The browser has already done the encoding, so save the values as is
                    addNonEncodedArgument(name, value, metaData);

Generated by  Doxygen 1.6.0   Back to index