[英]How to send body in a HTTP Get Request Angular 9
I could send a body(json) in Postman for a GET request.我可以在 Postman 中发送一个正文(json)以获取 GET 请求。
My Problem is I am not able to do the same in my yes-no.service.ts file.我的问题是我无法在我的 yes-no.service.ts 文件中做同样的事情。
getYesNoDropdowns() {
return this.http.get(AppComponent.lookUpListUrl, { headers: headers });
}
How do I achieve this?我如何实现这一目标? I have to use only Get.我必须只使用Get。
Thanks in advance!提前致谢!
Posts have a body, gets do not.帖子有正文,但没有。 You will need to put the data on the query string if you are using a get.如果您使用 get,则需要将数据放在查询字符串中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.