You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
def getResponseHeaders(conn: HttpURLConnection): Map[String, List[String]] = {
// according to javadoc, there can be a headerField value where the HeaderFieldKey is null
// at the 0th row in some implementations. In that case it's the http status line
val map = Stream.from(0).map(i => i -> conn.getHeaderField(i)).takeWhile(_._2 != null).map{ case (i, value) =>
Option(conn.getHeaderFieldKey(i)).getOrElse("Status") -> value
}.toList.groupBy(_._1)
for ( (k,v) <- map ) yield k -> v.map(_._2)
}
The text was updated successfully, but these errors were encountered:
Headers could contains many values for same key (see Set-Cookie - http://en.wikipedia.org/wiki/Http_cookie)
As s suggestion here is a dummy impl:
The text was updated successfully, but these errors were encountered: