When making a put request to sendgrid I get an error saying
invalid content-type: application/json; charset=utf-8
Is there a way to prevent the content type from including charset=utf-8
Here is a script that I use to reproduce this
var request = { "contacts": [ { "email": profile.PlayerProfile.ContactEmailAddresses[0].EmailAddress, "first_name": "Undefined", "last_name": "Undefined", "custom_fields": { "e6_T": "False", "e1_T": "Undefined", "e3_T": "Undefined", "e2_T": "Undefined", "e4_T": "Undefined" } }] }; var url = "https://api.sendgrid.com/v3/marketing/contacts"; var method = "PUT"; var headers = {}; headers['authorization'] = "MY_SECRET_KEY_HERE"; var EmailResponse = http.request(url,method,JSON.stringify(request), "application/json",headers);
As an alternative, is there a way of sending these requests with a XMLHttpRequest() instead?