when I'm unable to set the timeout when I use the HTTP client from the playframework. This is my code:
val request: Future[WSResponse] = WS
.url(url)
.withAuth(user, password, WSAuthScheme.BASIC)
//5 minute timeout in milliseconds
.withRequestTimeout(300000)
.put("")
This won't give me an error but the request will time out directly after 2 minutes. Is there something else which has to be set so that the timeout is used?
Update: I use the 2.4.8 version of playframework. It looks like this version has the following bug: https://github.com/playframework/playframework/issues/4846
However, the suggested hotfix isn't working for me eigher.
val request: Future[WSResponse] = WS
.url(url)
.asInstanceOf[NingWSRequest]
.copy(requestTimeout = Some(-1))
.withAuth(user, password, WSAuthScheme.BASIC)
.withRequestTimeout(-1)
.put("")
Both will give me a timeout after 2 minutes.
I can't guarantee this will work for you, but it seems to work for me and you could potentially adapt it:
Good luck.