💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## HttpServer::handleFunc ###接口说明 >绑定HTTP服务接口函数。 > +++ put:handleFunc var:thread=当前线程句柄# var:func=对应函数# <<< success 无返回类型 +++ ###代码演示 ~~~ var test2(var httptype,var params,var socketIndex) { http.send(socketIndex,"ok"); } var http = new HttpServer; var main(var thread,var params) { http.init(thread); http.setPort(4601); http.setMaxSocketCount(5000); http.startService(); //lambda方式注册 http.handleFunc("/test",[](var httptype,var params,var socketIndex){ http.send(socketIndex,"ok"); }); //变量方式注册 http.handleFunc("/test2",test2); } ~~~