-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ResponseBodyInBytes is null when the response is not parseable #1909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also, if the Status Code of the response is 4XX - 5XX, it will throw the exception, so ResponseBodyInBytes will be null, also |
Looks really great. Any idea when 2.0.5 will be out? |
Just a question. With the default HttpConnection implementation, that uses an HttpWebRequest, when it issues the request, if it receives a 4XX - 5XX status code, it will throw a WebException. That will be caught by OnRequestCompleted handler, but a response won't be returned to the caller (other than the exception). I have tried you HttpConnection-CoreFx, which uses HttpClient instead, will let you handle the responses and the status codes peacefully. Do you have any plan to: Thanks a lot |
So by default webexceptions won't bubble out of the client mimicing the behavior of Using the default WebRequest based HttpConnection if we see a 500 you will get back an invalid response (response.IsValid == false) and However if the response is not json or empty we would still throw (something now fixed as per #1913) again something that will make it into 2.0.5 which we'll release today. |
In our scenario, we do not call directly ElasticSearch. We have a Web Load Balancer in the middle to balance the load between Nodes. Plus, we have an Nginx in the same server for security reasons.
Each one of those elements can return a response by themselves, and thus, the response might not be parseable by NEST. I those cases, it's vital for us to have the raw response. In NEST 1.7 we could read it. Now we cannot.
We have DisableDirectStreaming set to true, and we haven't set ThrowExceptions
The text was updated successfully, but these errors were encountered: