Asim Jena

Asim Jena

  • 1.8k
  • 79
  • 10.6k

how to give response "result":"Y" in web api for post method

Aug 27 2018 4:39 AM
public HttpResponseMessage CreateUpdateRegister(RegisterMaster request)
{
if(ModelState.IsValid)
{
CategoryAppServiceObj.CreateUpdateRegister(request);
var res=Request.CreateResponse(HttpStatusCode.OK,"");
// res.Headers.Location = new Uri(Request.RequestUri+request.result.ToString());
res.Content = new StringContent("Y", Encoding.UTF8, "application/json");
return res;
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest,ModelState);
}
}
 
this is my code how to do that 

Answers (2)