Code example for HttpGet

Methods: addHeader

0
		return Get(uri);
	} 
	 
	private static HttpResponse Get(String uri) throws ClientProtocolException, IOException
	{ 
		HttpGet request=new HttpGet(uri);
		request.addHeader("Content-Type", "application/json; charset=utf-8");
		 
		//HttpClient client = new DefaultHttpClient(); 
        // ÉèÖÃÇëÇó³¬Ê± 
        //client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000); 
        // ÉèÖöÁÈ¡³¬Ê± 
        //client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 10000); 
		 
		return new DefaultHttpClient().execute(request);
	} 
	 
	public static HttpResponse PutRequest(String uri, Bundle getParams, Bundle postParams) throws JSONException, ClientProtocolException, IOException
	{ 
		uri = uri + "?" + Util.GetParamsString(getParams);
		return Put(uri,postParams);