I have some categories in a formcontrol, I send them in an array of string like this:
[1,4,6]
And that is my actual code:
You can create object containing all parameters and pass this object to fromObject
property of HttpParamOptons
while creating HttpParams
let data={
firstname:'xyz',
lastname:'pqr'
}
let body=new HttpParams({fromObject:data})
this.http.post(URL, body, this.header).subscribe(data => {
....
}, error => {
....
})