Code example for HttpResponse

Methods: setEntity, setStatusCode

0
			@SuppressWarnings("rawtypes") Map jsonData) {
		 
		// Check if body data was given 
		if (jsonData != null) {
			JSONObject body = new JSONObject(jsonData);
			response.setEntity(new JsonResponse(body));
		} 
		 
		response.setStatusCode(HttpURLConnection.HTTP_OK);
		setCacheHeaders(response);
	} 
	 
	/** 
	 * Sends a 400 to the client. 
	 *  
	 * @param response The response object to use. 
	 * @param message The user-readable error message. 
	 */ 
	protected void respondBadRequest(HttpResponse response, String message) {
		 
		try {