【发布时间】:2016-01-01 06:12:03
【问题描述】:
我需要将以下表单数据发布到作为 webapi 的 URL 并且方法是 post
var surveyData = {
Name: xyz,
SetReminder: 'false',
NoOfReminder: '0',
StartDate: 'xyz',
EndDate: 'xyz',
Language: 'eng-us',
Duration: '1',
ApplicationName: 'xyz',
SurveyTypeName: 'zxy'
};
我编写了下面的代码,它调用了 wbeapi 的 post 方法,但该函数能够发送数据,但 post 方法无法读取使用 angular js 发送的数据。
function(surveyData) {
return $http.post(URL , surveyData,{
headers: { 'Content-Type': 'multipart/form-data' }
});
【问题讨论】:
-
我认为这个问题的第一个答案就是你所寻求的答案:stackoverflow.com/questions/24710503/…
-
链接中给出的代码不起作用
标签: javascript jquery angularjs angularjs-scope