Updated on 2026-08-11 GMT+08:00

URL Decoding

Function Name

$urlDecoder(String A)

Parameter Description

String A: parameter to be decoded. It can contain up to 2,000 characters. UTF-8 is used for decoding.

Function Description

After a custom URL encoding is performed on parameters in a request, the parameters need to be transcoded again so that they can be received and parsed by the requested service. URL decoding can be performed on parameters in API automation test cases.

Application Scenarios

This function can be used in the following parts of an API automation test case. (Do not use the function for environment parameters. Otherwise, input will be output.)

  • Request URL
  • Request header
  • Request body
  • Checkpoint property
  • Response extraction
  • if condition
  • for loop interrupt condition

Example

  • Request URL

    As shown in the following figure, the value of test in the request URL is the URL decoding function. Parameter A in the function is the encoded string abc123%E6%B5%8B%E8%AF%95.

  • Request header

    As shown in the following figure, the value of Accept-Encoding in the request header is the custom URL decoding function. Parameter A in the function is the encoded string abc123%E6%B5%8B%E8%AF%95.

  • Request body

    As shown in the following figure, the request body uses the URL decoding function. Parameter A in the function is the custom URL encoding function $urlEncoder(abc123Test).

  • Checkpoint property

    As shown in the following figure, the target value of the checkpoint property result is the custom URL decoding function. Parameter A in the function is the local parameter test. For details about how to set local parameters, see Local Parameters.

  • if condition

    As shown in the following figure, the target value of the if condition is the custom URL decoding function. Parameter A in the function is the environment variable status. For details about how to set environment parameters, see Setting Environment Parameters of an API Script.

  • for loop interrupt condition

    As shown in the following figure, the target value of the for loop interrupt condition is the custom URL decoding function. Parameter A in the function is the string abc123%E6%B5%8B%E8%AF%95.