Stijn
Stijn

Reputation: 5

Java string to URI with parameters

I have this query string to send a http request via a URI object, but the URI object reformats my query string, including the parameters.

Upvotes: 0

Views: 271

Answers (1)

Jeremy
Jeremy

Reputation: 326

You're adding the "query" part to the path. You want

queryString /* misnamed */ += "/v2/cart/addProduct";
String query = "?...";
...
uri = new URI("http", null, getDomain(), 80, queryString, query, null);

Upvotes: 1

Related Questions