apache

How to access HTTP response headers after making an HTTP request with Apache HttpClient

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.”

Problem

You need to access the HTTP response headers after making an HTTP request in your Scala code.

Solution

Use the Apache HttpClient library, and get the headers from the HttpResponse object after making a request:

Drupal mobile website/multisite installation and robots.txt

As I’m working on getting a mobile version of this site working, I ran into a problem with having a robots.txt file on a Drupal multisite installation. The root of the problem is that you need to have a robots.txt file like this on your mobile site:

User-agent: *
Disallow: /

That’s to keep the search engines from scanning and storing that content, which will be a duplicate of your main website.

Syndicate content