I want to add iPhone contact in Google contact. I was used Google contact API.but it give me error Content is not allowed in prolog. i searched this error but not succeeded.

i can authenticate Google through web view and get access-token. After that call API my request is http://www.google.com/m8/feeds/contacts/default/full?access_token=ya29.1.AADtN_V0YDqLjA7-GmIRZN6Z_yNdfe3z-AmZMx0-ZPPyAvJFsThMaT1E5aF1Qg

please help me regarding this issue.

method type = post

Content type = application/atom+xml;charset=utf-8

Thanks

有帮助吗?

解决方案

if you are json

application/atom+json;charset=utf-8

if your xml means try this

$headers = array('Content-Type: application/atom+xml; charset=utf-8',
'Content-Length: '. strlen($xml),
'Authorization: GoogleLogin '. trim($authToken)),
'Connection: close');

For more information:

or

check your xml document tag

<!-- Correct -->
<?xml version="1.0" encoding="utf-8"?>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top