https://grokonez.com/frontend/angular/angular-6/angular-6-httpclient-get-post-put-delete-requests-springboot-restapis-bootstrap-4
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient, HttpHeaders } from '@angular/common/http';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};
restItemsServiceGuardarEsal() {
return this.http
.post(this.guardarEsalURL,JSON.stringify({"email":"sidsfidf@gmail.com","id":100,"nombre":"adsfasdfasdf ","sitioWeb":"dsafsdf"})
, this.httpOptions) .pipe(map(data => data));
}
guardarEsal() {
this.restItemsServiceGuardarEsal()
.subscribe(
esalGuardar => {
this.esalGuardar = esalGuardar;
console.log(this.esalGuardar);
}
)
}
No hay comentarios:
Publicar un comentario