Setting the content-type of requests performed by jQuery jqGrid

Posted by Nigel on Stack Overflow See other posts from Stack Overflow or by Nigel
Published on 2010-04-20T13:53:16Z Indexed on 2010/04/20 14:13 UTC
Read the original article Hit count: 453

Filed under:
|

I am using the latest version of jqGrid: 3.6.4

This seems like a simple problem (or at least it did before I spent a few hours on it):

When the grid sends a request to the server (to a controller action), its content-type is always:

application/x-www-form-urlencoded; charset=UTF-8

and I would like it to be:

application/json; charset=utf-8

but I can find no way of setting the content-type (there is no contentType option as you would find on a $.ajax call for example).

So just to clarify, I am not asking how to set the content-type on a jQuery server request, but specifically using jqGrid, which does not provide an obvious option for doing this.

Thanks, Nigel.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jqgrid