简体   繁体   中英

Java string to URI with parameters

我有这个查询字符串,可以通过URI对象发送http请求,但是URI对象重新格式化了我的查询字符串 ,包括参数。

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM