标签:set nbsp erp time row reg ati exce str
添加httpcore
implementation ‘org.apache.httpcomponents:httpcore:4.4.13‘
新建一个服务
重写onCreate方法
super.onCreate(); HttpRequestHandler handler = new HttpRequestHandler() { @Override public void handle(HttpRequest request, HttpResponse response, HttpContext context) throws HttpException, IOException { response.setStatusCode(HttpStatus.SC_OK); response.setEntity(new StringEntity("<h3>Hello World!</h3>", ContentType.TEXT_HTML)); } }; HttpServer server = ServerBootstrap.bootstrap() .setListenerPort(8880) .registerHandler("*", handler) .create(); try { server.start(); } catch (Exception e) { }
重写onDestory方法
super.onDestroy(); server.shutdown(0, TimeUnit.SECONDS);
标签:set nbsp erp time row reg ati exce str
原文地址:https://www.cnblogs.com/JebediahKerman/p/13066285.html