【发布时间】:2015-02-06 13:53:39
【问题描述】:
我正在尝试将 json 发布到 api 并且它给了我以下错误...
http://www.website.com/getPriceNoAuth?json=[object%20Object]405(方法不允许)
这是我尝试发送的 json 对象及其 http 请求...
var productAttributes = {
"CostRequirements":[
{
"OriginPostcode":"BR60ND",
"BearerSize":100,
"BandwidthRequired":10,
"ProductCode":"CON-ELA",
"Term":36,
"Quantity":1
},
{
"ProductCode":"CON-ADD-IP4",
"Term":36,
"Quantity":0
},
{
"ProductCode":"CON-ADD-INT",
"Term":36,
"Quantity":0
}
]
}
this.getPrices1 = function () {
return $http.post('http://www.website.com/getPriceNoAuth?json=' + productAttributes ).
success(function(resp){
//log something here.
});
};
有人看到我做错了吗?谢谢。
【问题讨论】:
标签: javascript json angularjs rest