我有以下Angular 1.5 $ http请求:
this.$http({
method: 'POST',
url: "example.com",
data: {
"action" : "myAction"
},
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: function(obj) {...}
});
我试图将其重写为Angular2,但我不知道"数据"和" transformRequest"属性翻译。到目前为止,我有:
let options = new RequestOptions({
method: RequestMethod.Post,
headers: myHeader
});
this.http.post(
'example.com',
options
);
如何添加Angular2等效的"数据"和" transformRequest"?