Angular 11 POST 带有查询参数和请求正文的请求
Angular 11 POST request with both Query Parameter and Request Body
我想从我的 angular 11 应用进行 api 调用。我想要做的是使用命令参数向 api 发送 post 请求
请求包含一个参数和一个主体
你可以这样写
this.http.post(environment.CommercialAPI_SERVICE_URL+`Notes/Post_Note?idTier={idTier}` , note)
在你的第 3 张图片中你少了一个美元符号
this.http.post(environment.CommercialAPI_SERVICE_URL+`Notes/Post_Note?idTier=${idTier}` , note)
我想从我的 angular 11 应用进行 api 调用。我想要做的是使用命令参数向 api 发送 post 请求 请求包含一个参数和一个主体
你可以这样写
this.http.post(environment.CommercialAPI_SERVICE_URL+`Notes/Post_Note?idTier={idTier}` , note)
在你的第 3 张图片中你少了一个美元符号
this.http.post(environment.CommercialAPI_SERVICE_URL+`Notes/Post_Note?idTier=${idTier}` , note)