This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a very short recipe, Recipe 15.12, “How to access HTTP response headers after making an HTTP request with Apache HttpClient.”
You need to access the HTTP response headers after making an HTTP request.
Use the Apache HttpClient library, and get the headers from the
HttpResponse object after making a request: