0

I am trying to send the the parameters using a post request but the parameters are not reaching to provide back the desired result and printing null as a result in console. here is my code

 var headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded' );
    let options = new RequestOptions({ headers: headers });
 
    let postParams = {
      acesscode: 'XXXXXXXXXXX',
      productCode:'XXXXXXXXXX'
    };
    
    this.http.post("http://www.ebiebook.com/drmapi/v1/details", JSON.stringify(postParams), options)
      .subscribe(data => {
        console.log(data['_body']);
       }, error => {
        console.log(error);// Error getting the data
      });
  
}

and the output screen is attached, It shows API is hitting well but the parameters data is unable to reach to provide the corresponding result. Please suggest. enter image description here

supriya chauhan
  • 289
  • 1
  • 5
  • 19

1 Answers1

0

This print you have attached does not show what is being sent by the request, instead it shows only the response your browser received from the server.

You better take a look at this thread here to see in this thread more about. You have to check the 'Headers' tab from Chrome's console -> Network.

Christian Benseler
  • 7,907
  • 8
  • 40
  • 71