REST call string: illegal character - Mendix Forum

REST call string: illegal character


Hi all,

I am building a autocomplete function for an address, I am getting the following error:

com.mendix.modules.microflowengine.MicroflowException: Illegal character in query at index 76:

This is an example python code on the documentation for API:

 request = request + '/?' + queryString + "&token=" + str(token)

Currently we are building the string using Mendix with a java action. 

Looks like there is an issue with the ampersand character. 

Any thoughts? 

1 answers

I would think either your query string or token has an illegal character in it. How are you building it?

Assuming you have the query string in a variable called $queryString, and the token in a variable called $token, you could look to build the URL using urlEncode to encode those value like this.

'' + urlEncode($queryString) + '&token=' + urlEncode($token)