Code example for HttpPut

Methods: setHeader

0
	    	 
	    	boolean resul = true;
	    	 
	    	HttpClient httpClient = new DefaultHttpClient();
	         
			HttpPut put = new HttpPut("http://10.0.2.2:2731/Api/Clientes/Cliente");
			put.setHeader("content-type", "application/json");
			 
			try 
	        { 
				//Construimos el objeto cliente en formato JSON 
				JSONObject dato = new JSONObject();
				 
				dato.put("Id", Integer.parseInt(params[0]));
				dato.put("Nombre", params[1]);
				dato.put("Telefono", Integer.parseInt(params[2]));
				 
				StringEntity entity = new StringEntity(dato.toString());
				put.setEntity(entity);
				 
	        	HttpResponse resp = httpClient.execute(put);