I have a simple react application using amplitude-js to send payloads to our API. Our API controller accepts and parses json message (application/json;charset=utf-8) but amplitude-js sends data in format data.
I tried below code in my react application where I initiate amplitude intance but it doesn't work, it still sends the data in application/x-www-form-urlencoded format which is default:
const amplitudeInstance = amplitude.getInstance("test").init("21e0fe6c98573ae71d209cb8ec4e85eb", null, {<br /> // optional configuration options<br /> saveEvents: false,<br /> forceHttps:false,<br /> headers: {<br /> 'Content-Type': 'application/json;charset=utf-8'<br />},<br /> apiEndpoint:'localhost:8080/events/publish',<br /><br /> logEvent:'test data'<br />})<br />So my question is why can't I change amplitude-js's content-type as they mention in docs:
https://developers.amplitude.com/docs/javascriptdeoland (Configuring HTTP Headers)
Thanks