Content-Type is header not set correctly
I am attempting to update a contact in Google Contacts with postURL. It fails with error code 415 which seems
to be connected with the content type. The Google contacts API requires atom+xml content type. I set the header for "Content-Type" to "application/atom+xml".
API = gAPI [Name = "Contacts"];
header = map();
header.put("GData-Version", "3.0");
header.put("Authorization", "Bearer " + API.Auth_Token);
header.put("If-Match", "*");
header.put("X-HTTP-Method-Override", "PUT");
header.put("Content-Type", ("application/atom+xml"));
In an attempt to troubleshoot this I posted the url to requestbi.n to see what headers postURL was actually sending. The output is below and shows the Content Type to be application/octet-stream. This appears to be the default content type if I leave the content type out of the header.
If-Match: *
Content-Type: application/octet-stream
Host: requestb.in
Authorization: Bearer xxxx
Gdata-Version: 3.0
Any help is appreciated.
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.