Code example for StringEntity

Methods: setContentType

0
	 *  
	 * @throws Exception 
	 */ 
	private void crearPrestacion() throws Exception { 
 
		StringEntity input = new StringEntity("{\"encounterDatetime\": \""
				+ date + "\", " + "\"patient\" : \"" + pacienteUuid + "\", "
				+ "\"encounterType\": \"" + tipoUuid + "\"" + "}");
		 
		input.setContentType("application/json");
		 
		if (ApiAuthRest.getRequestPost("encounter", input) == true) {
			Toast.makeText(getApplicationContext(),
					"Prestacion creada correctamente ", Toast.LENGTH_LONG)
					.show();
		} 
	} 
}