Code example for HttpPut

Methods: setEntityaddHeader

        Log.i(tag, result);
     } //  
    public void callWebServiceForUpadateState(String id,String Data){
        HttpClient httpclient = new DefaultHttpClient();
        HttpPut sender = new HttpPut(URL+"events/"+id+".json");
        //sender.addHeader("Accept"," application/json"); 
        sender.addHeader("Content-Type", "application/json");
        sender.addHeader("deviceId", deviceId);
        try { 
			sender.setEntity(new StringEntity(Data));
        	//sender.setEntity(new UrlEncodedFormEntity(pairs)); 
		} catch (UnsupportedEncodingException e1) {
			// TODO Auto-generated catch block 
			result="excepcion en try sender ";
        try { 
        	//ResponseHandler<String> handler = new BasicResponseHandler(); 
            //result = httpclient.execute(sender, handler); 
            HttpResponse response = httpclient.execute(sender);
            //String x=""; 
Connect your IDE to all the code out there  Get Codota for Java