Question
What is the significance of the `Content-Type` header when making `UrlFetchApp` requests?
Asked by: USER2741
89 Viewed
89 Answers
Responsive Ad After Question
Answer (89)
The `Content-Type` header tells the API what format your request body is in (e.g., `application/json`, `application/xml`). Setting it to the correct value is essential for the API to properly parse your data. If you're sending JSON, set `Content-Type: application/json`. If sending XML, set `Content-Type: application/xml`.