Hi

c# Web API Returning 400: BAD REQUEST - The request could not be processed 
by the server due to invalid syntax

from angular httpclient post method but

the same is working with get method

in Postman every thing is working fine

Here is the angular code

var headers = new HttpHeaders();
    headers.append('Content-Type', 'application/json');
var options = {
      headers: headers
   }
this.http.post(this.url,
   {
    "User_Id":  "1",
    "User_Name":  "arjun",    
},options)
.subscribe(
data  => {
console.log("POST Request is successful ", data);


Web API Code :

public HttpResponseMessage Post([FromBody]User user) {
  var message = Request.CreateResponse(HttpStatusCode.Created, user);

                    return message;
}


Any suggessions

Thanks
Arjun

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/96f12e24-9ade-4762-b534-f32cf8bd5748%40googlegroups.com.

Reply via email to