How to send JSON instead of a query string with $.ajax?

后端 未结 4 2169
一生所求
一生所求 2020-11-22 10:39

Can someone explain in an easy way how to make jQuery send actual JSON instead of a query string?

$.ajax({
    url      : url,
    dataType : \'json\', // I          


        
4条回答
  •  忘掉有多难
    2020-11-22 11:19

    If you are sending this back to asp.net and need the data in request.form[] then you'll need to set the content type to "application/x-www-form-urlencoded; charset=utf-8"

    Original post here

    Secondly get rid of the Datatype, if your not expecting a return the POST will wait for about 4 minutes before failing. See here

提交回复
热议问题