Error if url parameter in restfulAPI contains %

Asked 1 years ago, Updated 1 years ago, 86 views

I am creating a WEB API in playframework 2.x, but I get a Bad Request error when the url parameter contains %.

For example, when searching with the string "20% off"...

Bad Request For request 'GET/search?q=20%E3%82%AA%E3%83%95'
[Malformed escape pair at index 12:/search?q=20%E3%82%AA%E3%83%95]

Only % is not encoded

I'd like to do url encoding, but I don't know which file to modify, so I don't know which file to modify.
Could you give me instructions?

java api scala playframework

2022-09-30 14:31

1 Answers

As far as the string passed as the query string is concerned, out of 20% off, only the "off" is encoded, and the "%" character itself is not encoded, so that may be the reason for the error.


2022-09-30 14:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.