JMeter interface HTTP request implementation do not select Java will error resolution method

Source: Internet
Author: User

1. If the C parameter and D parameters are not URL encoded, you need to choose implementation as Java;

2. If you want to not set the implementation value, you need to do the C parameter D parameter urlencoding

1 Importjava.io.UnsupportedEncodingException;2 ImportJava.net.URLEncoder;3      Public StaticString UrlEncode (string result)throwsunsupportedencodingexception{4StringBuffer Urle =NewStringBuffer ();5String[] results = Result.split ("&");6             inti = 0;7              for(String tempstr:results)8             {9                 intStart = Tempstr.indexof ("{"); Ten                 intEnd = Tempstr.lastindexof ("}") +1;  One                 //the string combination to UrlEncode AString str =tempstr.substring (start, end); -String key = Tempstr.replace (str, ""); -                 //the message body of UrlEncode theString data = Urlencoder.encode (str, "UTF-8")); -                 if(I > 0) -                 { -Urle.append ("&"); +                 } - urle.append (key); + urle.append (data); Ai++; at             } -             returnurle.tostring (); -     } -String req =UrlEncode (Parameters); - Log.info (req); -Vars.put ("req", req);
View Code

JMeter interface HTTP request implementation do not select Java will error resolution method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.