Question
Pegasystems Inc.
JP
Last activity: 30 Jul 2015 0:54 EDT
Connect REST wizard test run fails with message "Execution failed : Illegal character in query" (PRPC 7.1.7)
I am trying to access google books rest api using connect rest wizard and got below errors.
Endpoint URL: https://www.googleapis.com/books/v1/volumes?q=Software Design + intitle:Architecture&maxResults=1&printType=books
However, google returns results without any error if I put the same endpoint URL directly in my browser's address bar.
It seems the wizard doesn't handle space in the parameter value properly, when there is extra filtering keys (i.e. intilte) specified.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems
Which version of Pega 7 are you using?
I remember there was a similar issue die to the presence of + in query string.
and was fixed in ML8 release.
Pegasystems Inc.
CA
Have you tried replacing space with %20? Use this URL in the REST wizard and it should work fine.
I just tested this on a 7.1.7 reference system and I was able to execute the test fine.
Pegasystems Inc.
JP
Yes, I have tried it. So, is it the intended spec or just a bug?
Although it works if you replaces all spaces with %20, I think any characters that are subject to URL encoding should be handled by the wizard itself instead let developers input URL encoded string.
Pegasystems Inc.
CA
I agree. What you are seeing appears like a bug. The wizard should automatically encode URL unsafe characters. Surprisingly, I retested your original URL (without %20) in 7.1.7 and it seems to work fine. Here is the URL to the reference system. http://vref71ml7:7350/v71ml7/PRServlet
And here is the screenshot of the wizard.
Pegasystems Inc.
CA
Update:
I see what you must have done to replicate the problem. Have you entered the query string value in the test dialog directly instead of starting off the wizard with the complete URL? When I did that, I see the problem you are seeing. That's a bug we fixed in 7.1.8.
Pegasystems Inc.
JP
Is it working with space? It seems you replaced space with plus sign in your screenshot.
Updated: 30 Jul 2015 0:37 EDT
Pegasystems Inc.
CA
See my update below that post. I didn't change the value in the query string field. I entered your original URL https://www.googleapis.com/books/v1/volumes?q=Software Design + intitle:Architecture&maxResults=1&printType=books in the first step of the wizard (Enter URL). That ‘+' was automatically added in the subsequent steps and so it worked in my case. If I replace + with space, it would fail as you observed. That's still a bug though that we fixed in 7.1.8.
Pegasystems Inc.
JP
Great, thanks for your update.
Pegasystems Inc.
JP
Is replacing white space to plus sign safe?
Isn't it going to change the meaning of the plus sign placed before the filtering key (i.e. intitle) ?
Pegasystems Inc.
CA
Ideally, the literal plus should be encoded as %2B. Space is encoded as %20 in UTF8 mode and as + in RFC2396 mode.
Both these URLs return the same results when executed through the browser and through the 7.1.8 wizard though.