0

My get method Api is "http://abc/abc"

Actually, get method contains is like, get(url,options), only two arguments.

But in my case I have to pass the body with this.. Body is like,

{
    "startIndex":"1",
    "count":"150",
    "groupBy":"product",
    "searchTerm":"product:product1"
}

How I will pass this with get method? Can anybody help me??

Angel Reji
  • 393
  • 2
  • 5
  • 20

2 Answers2

0

The information must be sent as a parameter through the url

   let startIndex="1";
    let startIndex="150";
    let startIndex="product";
    let searchTerm="product:product1";
     return this.http.get(`http://abc/abc?startIndex=${startIndex}&count=${count}&groupBy=${groupBy}&searchTerm=${searchTerm}`);
iman madani
  • 269
  • 1
  • 12
0

You cannot pass a body in Get response. Make it post(URL, options) and inside the subscribe get the response. This will have dynamic data calling