Google Reader API HTTP 响应解析(目标 C)
使用 API,尝试获取特定提要中的项目会返回:
{“direction”:”ltr”,”id”:”feed/http://arstechnica.com/index.rssx","title":"Ars Technica","description":"技术的艺术","self":[{"href ":"http://www.google.com/reader/api/0/stream/contents/feed/http://arstechnica.com/index.rssx?ot\u003d1273193172856169\u0026r\u003dn\u0026xt\u003duser //state/com.google/read\u0026n\u003d4\u0026ck\u003d1273193873\u0026client\u003diPadReader"}],”alternate”:[{"href":"http://arstechnica.com/index.php","type":"text/html"}],”已更新”:1273193873,”items”: []}
它们看起来像键/值对,但它是使用 UTF8 字符串编码的纯文本,不会编码到字典中。我正在使用 Objective-C,但我不知道接下来该去哪里。到目前为止,我已经能够解析未读项目的 XML 响应,但解析纯文本看起来并不可行。你的做法是什么?
Using the API, trying to get items in a specific feed returns this:
{“direction”:”ltr”,”id”:”feed/http://arstechnica.com/index.rssx”,”title”:”Ars Technica”,”description”:”The Art of Technology”,”self”:[{"href":"http://www.google.com/reader/api/0/stream/contents/feed/http://arstechnica.com/index.rssx?ot\u003d1273193172856169\u0026r\u003dn\u0026xt\u003duser/-/state/com.google/read\u0026n\u003d4\u0026ck\u003d1273193873\u0026client\u003diPadReader"}],”alternate”:[{"href":"http://arstechnica.com/index.php","type":"text/html"}],”updated”:1273193873,”items”:[]}
They look like key/value pairs but it’s plain text with UTF8 String encoding and won’t encode into a dictionary. I’m using Objective-C and I’m not sure where to go from here. So far I’ve been able to parse the XML response for unread items, but parsing the plain-text doesn’t look feasible. What is your practice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它看起来像 JSON 标记。您需要使用 JSON 解析器< /a> 对于 Objective-C。
It looks like JSON markup. You'll want to use a JSON parser for Objective-C.