简体   繁体   English

在 ZK 6 中接收 JSON POST 数据

[英]Receive JSON POST data in ZK 6

I am writing an application that will send JSON data via POST with PHP cURL and then the data will be read by ZK 6 application and processed, how can I achieve this?我正在编写一个应用程序,它将通过 POST 使用 PHP cURL 发送 JSON 数据,然后数据将由 ZK 6 应用程序读取并处理,我该如何实现? Thanks.谢谢。

[Edit] [编辑]

I wanted to create a web service.我想创建一个网络服务。

Since ZK applications are running in a Servlet Container (eg Tomcat/Jetty) you can just create/configure an HttpServlet implementation in your web.xml and post data to it using any kind of HttpClient ... be it a browser or a command line tool such as cURL or from PHP code.由于 ZK 应用程序在 Servlet 容器(例如 Tomcat/Jetty)中运行,您只需在 web.xml 中创建/配置HttpServlet实现并使用任何类型的 HttpClient 将数据发布到它......无论是浏览器还是命令行工具,例如 cURL 或来自 PHP 代码。

From a ZK perspective however this doesn't seem to make much sense yet with the given information.然而,从 ZK 的角度来看,对于给定的信息,这似乎没有多大意义。 A ZK application is running in a browser and depends on an HttpSession . ZK 应用程序在浏览器中运行并依赖于HttpSession

What you didn't tell is, where your application is currently running ... in an IFrame or in a headless browser at server side?您没有告诉的是,您的应用程序当前在哪里运行……在 IFrame 中还是在服务器端的无头浏览器中? Where do you want to send the information?您想将信息发送到哪里? To the overall application or a specific Session or even specific browsertab?到整个应用程序或特定的 Session 甚至特定的浏览器标签?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM