With the following code when sending a POST with HTTPClient of Angular 5
let params = new HttpParams({ // ==== NO FUNCIONA BIEN ¿? !!
fromObject: {
topic_id: topic_id.toString(),
answer_id: answer_id.toString(),
question_id: question_id.toString(),
...this.commonParams()
}
});
let params2 = { // ==== así SI funciona
topic_id: topic_id.toString(),
answer_id: answer_id.toString(),
question_id: question_id.toString(),
...this.commonParams()
};
console.log(' ............', params2);
return this.http.post(this.url + '/respuesta', params2);
If I use "param" I do not see the data (or I do not know how to read them on the REST server) and if I use "param2" (an object directly) there's no problem ...
I can not understand why
thanks