English 中文(简体)
Java 兼容的 REST Ruby 客户端
原标题:Java compatible REST client in Ruby

我需要建立一个客户图书馆,通过HTTPS获得以RET为基础的网络服务。

不怎么熟悉爪哇, 我想在鲁比这样做,然后编成一个罐子。

我发送的载荷将是(在JSON) 类似的东西:

{
  "api-token": "12345",
  "org_number": 5,
  "name": "ABC corp",
  "users": {
    "employee_number": 1,
    "name": "bob jones",
    "email": "[email protected]"
  }
}

我想客户图书馆需要:

  • Initialize a new API interface instance with API token
  • Give the instance organization information and set of users
  • Tell the instance to serialize the organization and users to JSON, and POST to the webservice /org/new

所以,我的问题是:

问题回答

你考虑过朱比吗?

https://github.com/jruby/jruby/wiki

你听说过""https://github.com/zertico/api-client/" rel="nofollow" >ApiClient 吗?

它在铁路内运作良好, 使您的控制器尽可能薄。 但它也用于非铁路应用程序 。

它为每种类型的 http 代码响应提出了不同的例外, 使 u 更容易控制基于服务器响应的客户逻辑 。

它自动初始化对象, 使用 pi 响应给您, 并发送 Json 的所有请求 。

它仍在发展之中,所以请让我知道我们可能需要的任何特征。

我用它来访问API, 需要给UANDTH2一个标记, 目前效果相当不错。

希望你享受。 =)





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签