✏️ Explanatory Question

What is the significance of the Content-Type header in AJAX requests?

👁 84 Views
📘 Detailed Answer
🟢 Easy
84
Total Views
10
Related Qs
0%
Progress
💡

Answer with Explanation

Answer: The Content-Type header in AJAX requests specifies the type of data being sent to the server. For example, when sending data in the request body, the Content-Type header informs the server about the format of the data, whether it's JSON, XML, or another format. Properly setting the Content-Type header is essential to ensure that the server interprets the data correctly.