问题:
I have a function which does a http POST request. 我有一个执行http POST请求的函数。 The code is specified below. 该代码在下面指定。 This works fine. 这很好。
$http({
url: user.update_path,
method: "POST",
data: {user_id: user.id, draft: true}
});
I have another function for http GET and I want to send data to that request. 我为http GET提供了另一个功能,我想将数据发送到该请求。 But I don't have that option in get. 但是我没有那个选择。
$http({
url: user.details_path,
method: "GET",
data: {user_id: user.id}
});
The syntax for http.get is http.get的语法是
get(url, config) 获取(URL,配置)
解决方案:
参考一: https://stackoom.com/question/vjcc/AngularJS将数据传递到-http-get请求参考二: https://oldbug.net/q/vjcc/AngularJS-passing-data-to-http-get-request
来源:oschina
链接:https://my.oschina.net/u/4428122/blog/4411224