Now for the possible reasons of this timeout:
- incorrect baseUrl
- forcing
content-length
header to an incorrect value - weird server that doesn’t like this
user-agent
header value - buggy server that doesn’t properly fail on a bad request, eg missing some request header, or:
s"""{
| "refresh_token": "${Configuration.apiKey}"
|}
""".stripMargin
Do you realize that you don’t have a pipe character on the last line? As a result, the actually String will end with a line feed and several white spaces. Maybe that’s what causing your application to choke. If so, I would also argue that your application should reply with 400: Bad Request
instead of timing out.