Encode URL Special Characters
In SCAPI, the comma (,) is used as a value separator and percent sign (%) is used for URL encoding.
These characters are treated as reserved characters and must be additionally URL encoded in UTF-8 when used within the following resource identifiers for SCAPI requests:
- Request path parameters
- Query parameters
for example: productID
, categoryID
, and promotionID
.
If a comma (,) or percent sign (%) is contained within resource identifiers in request path parameter values, the values must be additionally URL encoded in UTF-8. The following example shows a request for the productId
resource identifier: "Flour,1KG":
When the client submits the request, the request is usually automatically encoded one more time by the HTTP library and sent to SCAPI:
SCAPI decodes the resource identifier in the request:
If a comma (,) or percent sign (%) is contained within resource identifiers in query parameter values, the values must be additionally URL encoded in UTF-8. The following example shows a request for the productId
resource identifier: "Flour,1KG" and "1%Milk":
When the client submits the request, the request is usually automatically encoded one more time by the HTTP library and sent to SCAPI:
SCAPI decodes the resource identifier in the request:
We generally recommend NOT using special characters like commas (,) or percent signs (%) within resource identifiers.