

The stack trace doesn't always look like that but it always is stuck on epoll_wait/epoll_pwait often from gpr_cv_wait. Tag=0x0) at src/core/lib/surface/server.c:1486
#Yep message core code
It serializes the HTTP content to a string as an asynchronous operation.Īfter that I can convert my JSON string to an object and access the error/success message and the Status Code too.Thread 21 (Thread 0x7f54f6bff700 (LWP 51033)): If the call is successful, I am packing the response in JSON too. Tnxresult = JsonConvert.DeserializeObject(AppFunctions.CleanResponse(responseBody)) ĪpiError rs = JsonConvert.DeserializeObject(AppFunctions.CleanResponse(responseBody)) Response = await ApiHandler.HttpClientPost((tokenName), postdata, url) Var postdata = JsonConvert.SerializeObject(donor)

Note that I am checking the IsSuccessStatusCode. This is my controller code, where I call the function and read the response and determine whether I have an error or not and respond accordingly. HttpResponseMessage response = await client.PostAsync(uri, new StringContent(postdata)) public static async Task HttpClientPost(string header, string postdata, string url)Ĭ() Ĭ(new MediaTypeWithQualityHeaderValue("application/json")) Ĭ = new AuthenticationHeaderValue("Bearer", header) This is my function using the HttpClient. HttpClient does not throw any error when the HTTP response contains an error code, but it sets the IsSuccessStatusCode property to false. I had the same problem and after some research, I found out I could use HttpClient to call my API and read the response easily. Here is something I have been trying with the shim but it isn't working: // GET: api/customers/ Is there a new way of doing these things in Core 1.0?
#Yep message core install
I do see some documentation out there using HttpResponseException(HttpResponseMessage), but in order to use this, I have to install the compat shim. If there truthfully is no solution can someone tell me why? I don't understand why this isn't a common thing that people need. I have tried so many things, but nothing implements IActionResult.
#Yep message core how to
I have an ASP.NET Core 1.0 Web API application and trying to figure out how to pass the exception message to the client if a function that my controller is calling errors out.
