📜  django ajax 正文到 json - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:31.035000             🧑  作者: Mango

代码示例2
// From AJAX you need to post the data as JSON string rather than 
// a JavaScript object.
payload = JSON.stringify({"name": "foo", "username":"bar"})

$.ajax({
  url: 'some url',
  type: "POST",
  // ...
  data: payload,
  dataType: 'json',
  //..
})