proshin-roman / finapi-java-client

True-OOP Java client for API provided by https://finapi.io
Apache License 2.0
22 stars 7 forks source link

Query param are encoded twice #362

Closed ptrepkaVL closed 3 years ago

ptrepkaVL commented 3 years ago

Hello,

There was a ticket #279 which should fix the problem but I was done incorrectly and it still doesn't work.

There is a class QueryParamEncodedPair which return encoded value

public String getValue() {
    return UriUtils.encodeQueryParam(this.origin.getValue(), StandardCharsets.UTF_8);
}

Then this class is used when uri is build by uri builder: class FpEndpoint -> method get:

URIBuilder builder = new URIBuilder(this.endpoint + path);
builder.setParameters(new ListOf(parameters));
HttpUriRequest get = new HttpGet(builder.build());

And this builder.build encode parameters again. So instead of using QueryParamEncodedPair there should be BasicNameValuePair class passed to this method. Can you change it?

Best regards, Przemek