一直在使用$resource.save(object)
;将我的对象发布到休息服务,但这次我不希望对象被编组。我需要将其发布为text/plain
。
有没有一种简单的方法可以使用 angularJS ?
答案 0 :(得分:0)
解决了我的问题。
使用.save
或.post
函数中的配置参数来设置标题内容类型。
var config = {
headers : {
'Content-Type': 'text/plain'
}
};
$http.post(theURL, theBody, config)