2014-09-03 27 views
0

我使用的應用程序引擎的oauth2如下所示讓所有聯繫人我可以將Google Contacts API XML響應轉換爲Gdata提要對象嗎?

https://developers.google.com/api-client-library/python/guide/google_app_engine

if decorator.has_credentials(): 
    http = decorator.http() 
    resp, content = http.request(decorator._scope,method="GET") 

在這裏,我得到的所有聯繫人的xml響應... https://developers.google.com/google-apps/contacts/v3/#retrieving_all_contacts

在谷歌聯繫人API V3文檔(https://developers.google.com/google-apps/contacts/v3/)顯示瞭如何使用Gdata將數據作爲Feed對象進行操作。

我的問題是,我怎樣才能將我的resp轉換爲一個feed對象?我想知道在我自己開始解析XML之前這是否可能。

回答

1

您應該使用GData API client library for Python,它將爲您處理所有這些問題。

+0

我會用這個看看;我從應用程序引擎特定的庫開始,因爲它使得它本身很容易得到響應。 – user1961 2014-09-03 15:35:38

+0

Gdata庫被設計爲在App Engine上工作。 – David 2014-09-09 15:14:20

+0

我決定改變範圍來處理一個JSON響應,這個響應比較容易處理, https://www.google.com/m8/feeds/contacts/default/full?alt=json – user1961 2014-09-09 15:20:00

相關問題