Angular http.post() Syntax Issues with body

Discussão em 'Angular' iniciado por ali zaidi, Fevereiro 13, 2025.

  1. ali zaidi

    ali zaidi Guest

    This is the Postman screenshot by which I'm getting response successfully! And I want to fetch data in angular but the http.post() syntax issue occurs.

    [​IMG]

    const bodyCode = { seat_hell: "765", helloo: "1611255600" };

    export class DashDataTable22Component implements OnInit {

    data =[];

    constructor(private http:Http) {
    this.http.post('http://199.100.155.771/xyzza/', JSON.stringify(bodyCode)).subscribe(
    data =>{
    this.data = data.json();

    }
    )
    }

    Continue reading...

Compartilhe esta Página