tags:

views:

21

answers:

1

I have this currently in PHP and was wondering what the equivalent would be in Java.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $vals[$index["CM:URL"][0]]["attributes"]["VALUE"]);
header("Content-type: " . $vals[$index["CM:RESOURCEOBJECT"][0]]["attributes"]["MIMETYPE"]);
$content = curl_exec($ch);
curl_close($ch);

Thanks!

+1  A: 

See Apache HttpClient for the curl part.

With HttpServletResponse.addHeader, you can send your Content-type header.

Artefacto