Sample JAVA code |
/**
* Gets the media file content as a stream in the response.
* The content type is set as application/octet-stream
* Query Parameters that can be passes is summary.
*/
private static void getMediaFileContent() {
Client client = getSSLClient();
ClientFilter authFilter = new HTTPBasicAuthFilter("wsmadmin", "1234Ccbu1234");
client.addFilter(authFilter);
WebResource webResource = null;
webResource = client.resource(BASE_URI);
// GET the request
ClientResponse clientResponse = webResource.path
("/mediafile" + "/" + <path> + "/" + <mediafileName> + "/content").
accept(MediaType.APPLICATION_XML_TYPE).type(MediaType.MULTIPART_FORM_DATA).
get(ClientResponse.class);
}
|
Sample Response Header |
Response Status : 200
Response Headers : {Transfer-Encoding=[chunked],
Date=[Mon, 08 Apr 2013 14:44:19 GMT], Expires=[Wed, 31 Dec 1969 16:00:00 PST],
Content-Type=[application/octet-stream], Server=[Apache-Coyote/1.1],
Pragma=[No-cache], Cache-Control=[no-cache]
}
|