Excel, and others often issue HEAD requests (particularly when asking for metadata) to see if anything has changed.
Currently HEAD is an unsupported method.
As a workaround (non-optimal), you can implement a DelegatingHandler message handler and override SendAsync (lots of example online about how to override and insert a message handler in the configuration).
Before the base.SendAsync() call, you can then do something like the following:
bool isHead = request.Method == HttpMethod.Head;
if (isHead)
request.Method = HttpMethod.Get;
Which will change HEAD -> GET. After the call you can then blank the response:
if (isHead)
{
// We are head request, so blank the content.
response.Content = null;
}
Hope that helps someone else.
Comments: Hi, We are pretty late in the cycle for the current release milestone and have almost closed down for the current release. We are doing only critical functional bug fixes and hence moving any less severe bugs or feature requests to vNext. We understand the importance of this issue but have decided to move this to vNext as there is a workaround like you have mentioned. Once we start working on vNext, which will be very soon, we will look at these bugs again. Hope you understand. And thanks a lot for your time and effort, Appreciate it. Also we do accept pull requests. So, you can always send us new features or bug fixes too .
Currently HEAD is an unsupported method.
As a workaround (non-optimal), you can implement a DelegatingHandler message handler and override SendAsync (lots of example online about how to override and insert a message handler in the configuration).
Before the base.SendAsync() call, you can then do something like the following:
bool isHead = request.Method == HttpMethod.Head;
if (isHead)
request.Method = HttpMethod.Get;
Which will change HEAD -> GET. After the call you can then blank the response:
if (isHead)
{
// We are head request, so blank the content.
response.Content = null;
}
Hope that helps someone else.
Comments: Hi, We are pretty late in the cycle for the current release milestone and have almost closed down for the current release. We are doing only critical functional bug fixes and hence moving any less severe bugs or feature requests to vNext. We understand the importance of this issue but have decided to move this to vNext as there is a workaround like you have mentioned. Once we start working on vNext, which will be very soon, we will look at these bugs again. Hope you understand. And thanks a lot for your time and effort, Appreciate it. Also we do accept pull requests. So, you can always send us new features or bug fixes too .