Search code examples
angularresthttp-get

How to send body in a HTTP Get Request Angular 9


I could send a body(json) in Postman for a GET request.

enter image description here

My Problem is I am not able to do the same in my yes-no.service.ts file.

getYesNoDropdowns() {
  return this.http.get(AppComponent.lookUpListUrl, { headers: headers });
}

How do I achieve this? I have to use only Get.

Thanks in advance!


Solution

  • Posts have a body, gets do not. You will need to put the data on the query string if you are using a get.