Skip to main content
3 of 3
edited tags
Kevin Montrose
  • 18.7k
  • 6
  • 35
  • 62

Wrong content-type in JSONP calls

When passing jsonp parameter, the API returns "application/json" instead of "application/javascript".

I found this because if you do:

<script src='http://api.stackoverflow.com/1.0/badges?jsonp=results'></script>

On Google Chrome, it doesn't work. You need to add

<script src='http://api.stackoverflow.com/1.0/badges?jsonp=results' type='text/javascript'></script>

And even then you get a warning in the console.

Nothing serious but it's not a big change either.