第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在不使用request.post的情況下將ajax數(shù)據(jù)的所有數(shù)據(jù)獲取到django中

如何在不使用request.post的情況下將ajax數(shù)據(jù)的所有數(shù)據(jù)獲取到django中

楊__羊羊 2021-06-30 13:30:41
我想在不使用 request.post['name'] 的情況下將 ajax 請求的數(shù)據(jù)部分作為字典放入 django  $.ajax({        url: "getAppointments",        method: "POST",        data: data,   //I want to get this data as a dictionary in django        context: document.body,    }).done(function(data) {        alert("Successfully Edited");    }).fail(function(returnedText) {       window.alert("An error has occurred. Check log for details"+returnedText.responseText);       console.log(returnedText.responseText);    });
查看完整描述

2 回答

?
素胚勾勒不出你

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超9個贊

客戶端大?。?ajax 請求)和服務(wù)器大小(django)是兩個獨(dú)立的實(shí)體。因此,您必須getAppointments像任何其他請求正文一樣解析進(jìn)入您的路由的數(shù)據(jù)。

無論如何,request.POST在 django 中已經(jīng)是一個類似字典的對象:https : //docs.djangoproject.com/en/2.1/ref/request-response/#querydict-objects


查看完整回答
反對 回復(fù) 2021-07-06
  • 2 回答
  • 0 關(guān)注
  • 161 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號