Code example for HttpResponse

Methods: setEntity, setStatusCode

1
					"a=recvonly\r\n"+ 
					"a=type:broadcast\r\n"+ 
					"a=charset:UTF-8\r\n"+ 
					session.getSessionDescriptor();
			 
        	response.setStatusCode(HttpStatus.SC_OK);
        	EntityTemplate body = new EntityTemplate(new ContentProducer() {
        		public void writeTo(final OutputStream outstream) throws IOException {
        			OutputStreamWriter writer = new OutputStreamWriter(outstream, "UTF-8"); 
        			writer.write(sessionDescriptor);
        			writer.flush();
        		} 
        	}); 
        	body.setContentType("text/plain; charset=UTF-8");
        	response.setEntity(body);
			 
			// Start all streams associated to the Session 
			session.startAll();
			 
		}