如何通过 Apache 的 HttpClient 在 Couchdb 中设置管理员(给出了一个 curl 示例)
因此,我正在开发一个 CouchDB Gui 工具箱,以便更轻松地维护 Android 上的 CouchDB 设置,因为 Futon 在小型移动设备上非常不舒服。
我想坚持使用“org.apache.http.client.*”包,在我想设置管理员之前,它运行得很好。
使用命令行工具“curl”,它的工作方式就像一个魅力:
curl -X PUT http://127.0.0.1:5984/_config/admins/username -d '"password"'
但我保留将其转换为“org.apache.http.client.methods.HttpPut()”方法时遇到大问题。
任何帮助表示赞赏。
So I am working on a CouchDB Gui Toolbox for easier maintaining an setting up CouchDB on Android, as Futon is quite uncomfortable on a small mobile device.
I wanted to stick to the "org.apache.http.client.*" packages for this which was working out quite well until I wanted to setup administrators..
With the commandline tool "curl" it works like a charm:
curl -X PUT http://127.0.0.1:5984/_config/admins/username -d '"password"'
But I keep on having big problems translating that to a "org.apache.http.client.methods.HttpPut()" method.
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,抱歉。为了完成答案,以下是实际处理我收到的请求响应的方法:
Yes, sorry. Just to complete the answer, here's how to actually deal with the response I get for the request: