我使用包含管道符或“|”的URI调用HttpGet()请求在其中(url =“.... / AddGuestOrders?guestID = 1083& strListOfItemsWithQty = 19,1 | 20,1”)。
如果我直接使用它,它会抛出IllegalArgumentException。而不是“|”如果我使用ASCII值#124,那么也不会调用Web服务(尽管如果我使用#124 - > .... / AddGuestOrders?guestID = 1083& strListOfItemsWithQty = 19,1,它将从浏览器中正确调用12420,1)。我的代码是......
HttpGet httpget;
HttpEntity httpEntity;
HttpClient httpclient = new DefaultHttpClient();
httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget);
httpEntity = response.getEntity();
我需要帮助找到一些方法,以便我可以通过“|”在我的URI中。