Correct usage of wsClient.url(String) parameter?


(Doug Roper) #1

Hi,

I’ve encountered issues in our production applications from developers passing query params into the wsClient.url(url: String) parameter. AhcWSClient is quite tolerant of query params here and will include/encode/send them without issue. However, They don’t show up in the WSRequest queryString method and invoking the lazy val uri: URI will sometimes throw exceptions.

I’ve created https://github.com/playframework/play-ws/issues/267 to capture the full context of the issue along with an example.

What is the intended usage of the .url(...) method? Are query params here permissible? If not, should it fail-fast by throwing as declared by the @throws[IllegalArgumentException] annotation?

Would a PR to define and scaladoc this behavior be welcome against https://github.com/playframework/play-ws? I’d be happy to submit one, but need some direction to understand how this is intended to work.