Forum Discussion

mpw83's avatar
5 years ago

Getting 'Malformed escape pair' for '%' in query parameter

I am trying to filter some Id's in my query using Like '%Collections%' . I am sure the SQL is correct and working. But in SoapUI request I am getting `Malformed escape pair at index 202:`. S...
  • richie's avatar
    5 years ago

    Hi mpw83 


    I'm such an idiot sometimes - you told me the problem - I really dont know what I was thinking.  


    Its the percent encoding - you are using the SQL wildcard % in your query - but % is a reserved character in HTTP - so you can't just use it like you have (this is why quite often when representing SQL query hits like this, RESTful requests replace the % wildcard with an alternative so this isn't a problem


    Anyway - if you go into Projects and view either the method or resource - click on any parameter (header, query, template) to enable the functionality - at the bottom there is a checkbox that relates to disabling the URL/percent encoding.  I've never used this before but I suspect this will do what you need so ReadyAPI! doesn't trap your request - see the following screenshot

    An An alternative to disabling the percent encoding is to escape the % char in yoru request.


    %'s escape sequence is %25 - so if you replace '%Collections%' with '%25Collections%25' that should work.


    I encoded your whole URI query string - so 



    encodes as the following:




    Hope this helps,