0
我使用Play WSClient從其他應用程序調用一個應用程序。Play2 - 使用WSClient在請求中編碼特殊字符
parameter q value 'hello & hi' is encoded as 'hello%20%26%20hi'
String requestString = "http://localhost:9000/query?q=hello%20%26%20hi"
F.Promise<WSResponse> response = WS.url(requestString).get();
在其他應用程序收到請求時。 q參數值將成爲'你好'
如果從瀏覽器執行相同的請求,那麼它的工作正常和q參數值將是'你好& hi'。但是從WSClient玩起,它不起作用。
謝謝。我使用Activator 1.2.10,也會在其他版本中檢查它。 – Deepak 2015-04-06 02:50:16
順便說一句,通過使用setQueryParameter解決了這個問題。 – Deepak 2015-04-06 14:50:38