There are two approaches that you can set content-type
for a request.
1: Server Side
header('Content-Type: application/json');
2: Client Side
fetch('https://example/api', {
headers:{
'Content-Type': 'application/json',
},
I want to know, is setting the content-type
the duty of which developer? Backend or frontend? Or both of them? What's the standard way?