title: getting invalid request error in Observable while success in Promise?
body: <p>Created an API with both observable and Promise in Angular like:</p>
  
  <pre><code>submitEnquiry(details){
        console.log(JSON.stringify(details));
         return new Promise((resolve, reject) =&gt; {
             let headers = new Headers();
             console.log("TOKEN"+this.token);
             headers.append('Content-Type', 'application/json');
             this.http.post(this.apiUrl+"api/enquiry/request?token="+this.token, JSON.stringify(details), {headers: headers})
               .subscribe(res =&gt; {
                 let data = res.json();
                 resolve(data);
               }, (err) =&gt; {
                 reject(err);
               });
  
         });
       }
  </code></pre>
  
  <p>Second Method:</p>
  
  <pre><code>submitEnquiry(details):Observable&lt;any&gt; {
    const headers: HttpHeaders = new HttpHeaders();
    console.log(details);
    headers.append('Content-Type', 'application/json');
    headers.append('Authorization', 'Bearer '+this.authService.token);
    //return this.httpClient.get&lt;Product[]&gt;('http://13.126.17.194/colleges.php', {headers: headers.append('Authorization', this.authService.token)});
    return this.httpClient.post&lt;any&gt;(this.apiUrl+"api/enquiry/request?token="+this.authService.token, JSON.stringify(details),{headers:headers});
  }
  </code></pre>
  
  <p>The issue I am facing is that. the first one works and JSON data is entered into the server while when I am using the later one it gives me invalid request error! What am I missing here? I know the best method is to use the observable..</p>