我如何从 couchDB 数据库中获取 JSON 数据并在 Xcode 中解析它?

How do i get JSON data from a couchDB database and parse it in Xcode?

例如, 我的 CouchDB 数据库中有一个包含两个字段的文档 "password" 和 "username"。 这是我文档的 URL:http://127.0.0.1:5984/_utils/document.html?sgram/fdcfc14940fbaa0d86674046ce005107 我想从 CouchDB 中的特定文档中检索这些字段的值并在 Xcode 中解析它。 我尝试使用 http-get 但它只是 returns 整个页面源。

您想向此端点发出请求

http://127.0.0.1:5984/sgram/fdcfc14940fbaa0d86674046ce005107

对于来自 couchdb 的 json 响应,只是不要在两者之间包含 _utils/document.html。如果你这样做,它会把蒲团 html 页面还给你。