on 03-16-2022 1:01 PM
Dear SAP Community,
I created a simple cds entity with one key:
entity Documents {
key objectNumber : String(22);
lastCalled : DateTime;
}
Then I stored some values, like so:
{
"objectNumber": "1000/00225/0001/01",
"lastCalled": "2022-03-07T08:22:35Z"
}
Then I tried to use a GET HTTP Request like so:
GET http://localhost:8080/api/docservice/Documents('1000/00225/0001/01')
As a result of this request I get a 400 Bad Request. I tried to double escape the forward slashes with %252F, but then I get:
org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String "%25"
I researched the problem further and found this link
https://issues.oasis-open.org/browse/ODATA-1033, which suggests the following: "Services that support forward-slash in key values MUST support passing key values as parameters."
Similar question can be found here:
https://answers.sap.com/questions/13038318/cap-java-odata-string-as-odata-key-causes-problems.html
Can anybody suggest a solution for this problem? I am thinking right now to base64 encode the key and use its value as parameter.
Kind regards,
Vsevolod
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.