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
}
{
"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