Description
NEST do a POST request for Refresh method and does not set Content-Length header.
In common case NEST should set it, because POST request implies that you have message body, so you always should set Content-Length for POST requests (if no body provided then you should set zero)
http://www.w3.org/Protocols/rfc2616/rfc2616.txt
Elasticsearch is using Netty web server, that is tolerant and allows POST requests without Content-Length provided.
BUT if I use IIS reverse proxy behind of elasticsearch, then IIS not allowing such requests
If I use elasticsearch-head, then all is OK, elasticsearch-head is setting Content-Length:0 for Refresh method
I am not familiar with code, but I think changes required in file HttpConnection.cs
in method CreateWebRequest add something like
if (method == "Post"){
myReq.ContentLength = 0;
}
oк using IRequestConnectionConfiguration interface