我需要建立一个客户图书馆,通过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
所以,我的问题是:
- How do I structure my Ruby classes to produce an interface a Java programmer will be comfortable with (something like http://twitter4j.org/en/code-examples.html for example)