Forum Discussion

jyl's avatar
jyl
New Member
10 years ago

REST interface percent (%) not encoded when defined in a template parameter

When the URL is defined as http:// host::port/root_context/service/{param}

 

With parameter defined as follow:

  •    name : param
  •    value : REST_%_TestOfPercentEncoding
  •    Style: TEMPLATE
  •    Level : RESOURCE

 

Systematically the following error is returned whatever the encoding is activated or disabled

 

         Thu Jun 04 16:32:14 CEST 2015:ERROR:An error occurred [URLDecoder: Incomplete trailing escape (%) pattern], see error log for details

 

while normally URL should be encoded as follow http:// host::port/root_context/service/REST_%25_TestOfPercentEncoding

 

 

==> I do not understand what to do to make the URL works correctly in case of TEMPLATE.

 

Note that, it works correctly for the other cases:

* When I  redo the test with

        Style: QUERY

   the URL is correctly encoded as

       http:// host::port/root_context/service?param=REST_%25_TestOfPercentEncoding

 

* When I  redo the test with

       value : REST_ _TestOfSpaceEncoding

       Style: TEMPLATE

   the URL is correctly encoded as

       http:// host::port/root_context/service/REST_%20_TestOfSpaceEncoding

 

Regards

  • I've also experienced this exact same problem. Thanks for describing it so well.

    I've found some other strange behavior relating to this template parameter encoding.

     

    For example, if i use the following,

     

    value : REST_£_TestOfPoundSignEncoding

     

    My application receiving the request that is decoding has decoded the pound sign into '�' - which doesn't look right!

     

    I also tried disabling the encoding of this parameter. (by selecting it in the REST resource). Then using the value of  '%' in my template field, and this crashed soapUI. I could not re-open that test step until I went back into the resource to re-enable the encoding again.