流星客户端功能然后服务器端响应

时间:2021-11-10 16:23:34

A have a simple java app using the Apache HTTP libraries to communicate with a Meteor app. I am a bit of a Meteor newb so forgive me if this is simple but here goes - The idea is the java app will send a post request to log in, then send a second post request to generate a string, and if the user is logged in the string is returned via JSON, if not return "false" or something. However client-side you cannot return JSON, and server-side you obviously cannot check if your logged in. how can i check if a person is logged in but still return a raw JSON string?? Are there any other better ways of communicating with Java??

A有一个简单的Java应用程序,使用Apache HTTP库与Meteor应用程序进行通信。我有点像流星newb所以请原谅我,如果这很简单,但这里去了 - 想法是java应用程序将发送一个post请求登录,然后发送第二个post请求生成一个字符串,如果用户是记录在字符串中的是通过JSON返回的,如果没有返回“false”或其他东西。但是客户端你不能返回JSON,而服务器端你显然无法检查你是否登录。如何检查一个人是否登录但仍返回原始JSON字符串?还有其他更好的与Java通信的方法吗?

1 个解决方案

#1


0  

The easiest way to do this (which includes authentication) is to use a restapi, such as the one called restivus. https://github.com/kahmali/meteor-restivus

最简单的方法(包括身份验证)是使用restapi,例如名为restivus的restapi。 https://github.com/kahmali/meteor-restivus

It will allow your java app to authenticate and then request data, in a very standard restapi, which is easy for you to construct. The site has examples to help illustrate

它将允许您的Java应用程序进行身份验证,然后在非常标准的restapi中请求数据,这很容易构建。该网站有一些例子可以帮助说明

#1


0  

The easiest way to do this (which includes authentication) is to use a restapi, such as the one called restivus. https://github.com/kahmali/meteor-restivus

最简单的方法(包括身份验证)是使用restapi,例如名为restivus的restapi。 https://github.com/kahmali/meteor-restivus

It will allow your java app to authenticate and then request data, in a very standard restapi, which is easy for you to construct. The site has examples to help illustrate

它将允许您的Java应用程序进行身份验证,然后在非常标准的restapi中请求数据,这很容易构建。该网站有一些例子可以帮助说明