Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 4
    You wrote "so that jQuery doesn't attempt to URLEncode your data.", but it is not correct. To stop jquery from urlencoding your data you must set processData to false. Commented Oct 20, 2011 at 8:58
  • 8
    Passing in a string is enough to prevent jQuery from URLEncoding the data parameter. You can set processData to false, but it's superfluous (and doing that alone, without passing in a JSON string for the data, isn't enough). Commented Oct 20, 2011 at 16:16
  • 1
    This same issue (and answer) applies to Rails as well. Commented Jan 30, 2013 at 0:02
  • 2
    @DaveWard Does contentType is considered if we use GET and not POST ? Commented Jul 18, 2013 at 13:34
  • 1
    Use file_get_contents('php://input') to get your json data in php. Commented Mar 22, 2018 at 14:39