Home > front end >  Presents to send post data returns null
Presents to send post data returns null

Time:11-19

 
Const httpOptions={
Headers: new HttpHeaders ({' the content-type: 'text/plain'})
//headers: new HttpHeaders (). The set (' the content-type ', 'application/x - WWW - form - urlencoded')
};

 
Public save (user: TUser) : void {
The console. The log (' -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - save () -- -- -- -- -- -- -- -- -- -- - ');
The console. The log (user. The userName);
This. The HTTP post (' http://localhost:8080/users', JSON stringify (user), httpOptions)
The subscribe (
Res=& gt; {
console.log(res); //return null here
},
Err=& gt; {
The console. The log (' Error occured ');
}
);


When sending data, always returns Null values, and query data, using the Get is, no problem, please the great god, exactly what is the problem?
After all sorts of ways to try to online, still cannot solve the problem,
  • Related