Code example for HttpPut

Methods: addHeader

0
	public HttpBundle enable(String container, String ttl, String logRet)
			throws CloudServersException { 
		HttpResponse resp = null;
		CustomHttpClient httpclient = new CustomHttpClient(context);
		String url = getSafeURL(Account.getAccount().getCdnManagementUrl(), container);
		HttpPut put = new HttpPut(url);
 
		put.addHeader("X-Auth-Token", Account.getAccount().getAuthToken());
		put.addHeader("X-TTL", ttl);
		put.addHeader("X-Log-Retention", logRet);
		Log.d("info cdn", url);
		Log.v("info cdn", ttl + container + logRet);
		httpclient.removeRequestInterceptorByClass(RequestExpectContinue.class);
 
		HttpBundle bundle = new HttpBundle();
		bundle.setCurlRequest(put);
		 
		try { 
			resp = httpclient.execute(put);
			bundle.setHttpResponse(resp);
		} catch (ClientProtocolException e) {
			CloudServersException cse = new CloudServersException();
			cse.setMessage(e.getLocalizedMessage());
			throw cse;