简体   繁体   English

在现有的PHP服务器上构建REST Java API

[英]Building REST Java API on existing PHP server

In a recent academic project I need to create some REST Java API (web service) that works on an existing PHP server. 在最近的一个学术项目中,我需要创建一些在现有PHP服务器上工作的REST Java API(Web服务)。 I don't have much clear ideas on how to implement it. 对于如何实施它,我没有很多明确的想法。 How would you implement the logic? 您将如何实施逻辑? Is it okay to send a request (Ajax) to the web service, which it then forwards it to the PHP server? 可以将请求(Ajax)发送到Web服务,然后再将其转发到PHP服务器吗? How would you implement it? 您将如何实施?

Thank you for your advises! 谢谢您的指教!

Java REST service could call PHP REST service. Java REST服务可以调用PHP REST服务。 If REST service on php side not implemented, we can use some html robot for acting like a http client from java. 如果未实现php端的REST服务,我们可以使用一些html机器人来充当java中的http客户端。 HtmlUnit or Selenium for example. 例如HtmlUnit或Selenium。

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

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