private static String getHeaderValue(HttpResponse resp, String name) throws CloudAPI.ResolverException {
        Header h = resp.getFirstHeader(name);
        if (h != null && h.getValue() != null) {
            return h.getValue();
        } else {
            throw new CloudAPI.ResolverException("header " + name + " not set", resp);
        }
    }