DataOutputStream out = new DataOutputStream( new BufferedOutputStream(sock.getOutputStream())); out.writeBytes("HTTP/1.0 200 OK\n" + stdHeaders + "Content-Type: text/xml\n" + "Content-Length: " + result.length() + "\n\n"); byte[] resultData = result.getBytes("UTF8"); out.write(resultData, 0, resultData.length); out.flush(); out.close(); } catch (IOException io) { HttpServer.LOG.warn(io);
response = doPost(broker, content, path); } catch (BadRequestException e) { response = new Response(HTTP_BAD_REQUEST, e.getMessage()); } catch (PermissionDeniedException e) { response = new Response(HTTP_FORBIDDEN, e.getMessage());
	protected void post(String input, String name, int len, String contentType) {		String result = doPost(input, name);		if (result == null)			return;		try {			DataOutputStream out = new DataOutputStream(					new BufferedOutputStream(sock.getOutputStream()));			out.writeBytes("HTTP/1.0 200 OK\n" + stdHeaders					+ "Content-Type: text/xml\n" + "Content-Length: "					+ result.length() + "\n\n");			byte[] resultData = result.getBytes("UTF8");			out.write(resultData, 0, resultData.length);			out.flush();			out.close();		} catch (IOException io) {			HttpServer.LOG.warn(io);		}	}