コード例 #1
0
 public HttpResponseMessage UnprocessableEntity(HttpErrorResponse errorResponse)
 {
     return(new HttpResponseMessage((HttpStatusCode)422)
     {
         Content = new StringContent(JsonConvert.SerializeObject(errorResponse), Encoding.UTF8,
                                     ContentApplicationType.ApplicationJSON)
     });
 }
コード例 #2
0
 public HttpResponseMessage Conflict(HttpErrorResponse errorResponse)
 {
     return(new HttpResponseMessage(HttpStatusCode.Conflict)
     {
         Content = new StringContent(JsonConvert.SerializeObject(errorResponse), Encoding.UTF8,
                                     ContentApplicationType.ApplicationJSON)
     });
 }