0

I am trying to pass quesry as queryString function of UniRest. I was getting signature mismatch.

Afte check ing through all the function, I got to know unirest uses 'com.mashape.unirest.http.utils.Base64Coder;' to encode query params. This is encoding space in query param to '%20'.

My server expects '+' for space.

actual query String = "2023-01-05 00:00:00"
Unirest encoding = "2023-01-06%2000%3A00%3A00"
expected query String = "2023-01-06+00%3A00%3A00"
  • 1
    "2023-01-06%2000%3A00%3A00" is _not_ base64 encoded and what you have and want are 2 versions of url enconding. You could try and manually replace "%20" with "+" after encoding the value to get your result - not sure if url encoders will let you pick. You might also want to have a look here: https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20 – Thomas Jan 11 '23 at 07:54

0 Answers0