KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to pass a value with percent (%) sign in REST request
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: February 7, 2022

When writing a REST request, sometimes a value needs to be passed with a percent sign. To do this, the percent sign must be in a form of encoded character "%25" or "\u0025". For example, to pass “75% done” in the params property when filtering for progress in a Projects dataclass, the request may be written like this:

http://127.0.0.1:8080/rest/Projects/?$filter=“progress=:1"&$params=‘[“75%25 done”]’

Or this:

http://127.0.0.1:8080/rest/Projects/?$filter=“progress=:1"&$params=‘[“75\u0025 done”]’

In both cases, the param will be interpreted as "75% done" in the request.

For the encoded value for other symbol characters, please refer to HTML URL Encoding Reference - W3Schools