Q:

Exact syntax for multiple headers in Play! 2.0 WS request?

Trying to add multiple headers to a Scala Play! WS Request:
WS
.url(requestUri)
.withHeaders("Authorization" -> ("Oauth %s" format(cred.authorizedToken)),
    "Content-Type" -> "application/json")
.post(httpBody.get)

However it is currently failing. What's the proper syntax? I've tried multiple approaches but the compiler complains about java strings. Thanks!

A:

Your approach seems valid according to the documentation 
Ok("Hello World!").withHeaders(
  CACHE_CONTROL -> "max-age=3600", 
  ETAG -> "xx"
)

And the method definition validate your code too :
def withHeaders(hdrs: (String, String)*)
// Parameters are infinite couples of String

