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:`. Seems it does not like `%` character. Is there any way to solve this issue? help much appreciated.
Solved! Go to Solution.
can you show me the RAW of your request once submitted please?
I would expect the URI to be percent encoding so I'm curious as to whether this is being converted properly.
Also - it would help to diagnose your issue if you could provide the URI pattern of the query string so we can see what attributes are allowed/not allowed
@richie , Thanks for your reply. Because the request is not submitting due to this "MALFORMED_QUERY" issue the raw request is similar to as follows,
GET https://localhost:8080/services/data/v39.0/queryAll/ HTTP/1.1 Accept-Encoding: gzip,deflate Authorization: OAuth 00D0p0000000SLb!AQIAQLzs22Oa1qL8Hl6NsTHdlEq5aFPFFTsdEVTOnzwUJ.MCpSgF.33MBHvfL1lenIvNTkPI.jCqz9vEpFcmcQyVJsBWRvd1 Content-Length: 0 Host: localhost Connection: Keep-Alive User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_181)
the query that I am trying to execute is
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,