How to insert a new contact using Google CardDAV API? -


google carddav api developer's guide brief when comes contact manipulation. hint how insert new contact this:

client applications issue post request new contact in vcard 3.0 format. response contain id of new contact.

this request issue, response 400 bad request:

post https://www.googleapis.com/carddav/v1/principals/foo.bar@gmail.com/lists/default/ http/1.1 authorization: bearer ya29.foobar content-type: text/vcard; charset="utf-8" host: www.googleapis.com content-length: 77 expect: 100-continue connection: keep-alive  begin:vcard version:3.0 fn:foo bar uid:abc-def-fez-1234546578 end:vcard 

anybody has clue missing here?

do put, not post. this:

put /carddav/v1/principals/foo.bar@gmail.com/lists/default/deadbeef.vcf if-none-match: * authorization: ... host: www.googleapis.com content-type: text/vcard; charset="utf-8" expect: 100-continue  begin:vcard version:3.0 prodid:-//youyou//windows//en fn:foo bar n:bar;foo;;; uid:deadbeef end:vcard 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -