import httplib2
h = httplib2.Http(".cache")
resp, content = h.request("http://example.org/", "GET")
urllib2 の例に従って API に GET 要求を行う場合、返されるオブジェクトをどのように逆シリアル化すればよいですか?
たとえば、次のようなものがあるかもしれません
'{"total_results": 1, "stat": "ok", "default_reviewers": [{"file_regex": ".*", "users": [], "links": {"self": {"href": "http://localhost:8080/api/default-reviewers/1/", "method": "GET"}, "update": {"href": "http://localhost:8080/api/default-reviewers/1/", "method": "PUT"}, "delete": {"href": "http://localhost:8080/api/default-reviewers/1/", "method": "DELETE"}}, "repositories": [], "groups": [], "id": 1, "name": "Default Reviewer"}], "links": {"self": {"href": "http://localhost:8080/api/default-reviewers/", "method": "GET"}, "create": {"href": "http://localhost:8080/api/default-reviewers/", "method": "POST"}}}'
ただし、上記の応答は文字列です。簡単にクエリできるようにリストに変換する方法はありますか? これは API 呼び出しを行う背後にある正しい考えですか (これには新しい): HTTP API で要求を送信し、API ラッパーが存在しないと仮定して応答を解析しますか?