How to send requested parameters as a query params.
I tried like
addLocal(data: any) {
const queryParams = `?email=${data.email}&name=${data.name}&phone_number=${data.phone_number}`;
return this.httpclient.post('https://www.example.com/coming/receive' + queryParams);
}
But with this getting error accepted arguments 2-3.
How to call such requests
With json i used like below, but for passing data as query?
addLocal(data: any) {
return this.httpclient.post('https://www.example.com/coming/receive', data);
}
Try using like this,
return this.httpclient.post('https://www.example.com/coming/receive' + queryParams,{});
EDIT:
Http POST
takes resource URL as a parameter and additional two paramters
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.