Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSONP response http content-type header

Tags:

http

jsonp

What should the value of content-type http header be if the message body is JSONP. application/javascript?

like image 514
Alvin Avatar asked Jul 07 '11 21:07

Alvin


1 Answers

Depends on the body's actual content. That's what the Content-Type header stands for.

So, if you write a JS callback function to the body, then yes, it should be application/javascript.

Or, if you write a JSON string to the body, then no, it should be application/json instead.

like image 128
BalusC Avatar answered Nov 20 '22 02:11

BalusC