还可以使用fcgi4j这个java库
github地址https://github.com/Happyr/fcgi4j
使用方式
//create FastCGI connection
FCGIConnection connection = FCGIConnection.open();
connection.connect(new InetSocketAddress("localhost", 5672));
connection.beginRequest("/var/www/foobar.php");
connection.setRequestMethod("POST");
byte[] postData = "hello=world".getBytes();
//set contentLength, it's important
connection.setContentLength(postData.length);
connection.write(ByteBuffer.wrap(postData));
//print response headers
Map<String, String> responseHeaders = connection.getResponseHeaders();
for (String key : responseHeaders.keySet()) {
System.out.println("HTTP HEADER: " + key + "->" + responseHeaders.get(key));
}
//read response data
ByteBuffer buffer = ByteBuffer.allocate(10240);
connection.read(buffer);
buffer.flip();
byte[] data = new byte[buffer.remaining()];
buffer.get(data);
System.out.println(new String(data));
//close the connection
connection.close();
网友回复
UEFI与Legacy启动有啥不同?
可在u盘启动的开源匿名操作系统有哪些?
Pyloid与Pywebview打包生成桌面应用区别?
win10的iso镜像如何通过u盘来安装?
如何解决输入sora2邀请码报错:Sora is not available in The Netherlands yet
在哪可免费白嫖使用sora2生成视频?
php如何结合openai兼容的embedding向量化api实现语义化模糊关键词搜索匹配?
python如何结合qwen embedding向量化api实现语义化模糊关键词搜索匹配?
如何利用ai翻拍创作热门视频影视电视剧赚钱?
如何去除sora2生成的视频水印?