Microsoft KB Archive/251215: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 58: | Line 58: | ||
== CAUSE == | == CAUSE == | ||
Because no other | Because no other "Accept:" headers are specified, the Web server determines that the client can only handle text/plain and text/html content types. Because the document has no extension, the type is octet/stream, which causes the error message to be returned. This is by design. | ||
</div> | </div> | ||
Line 75: | Line 75: | ||
The following portion of code causes the Error 406: | The following portion of code causes the Error 406: | ||
<pre class="codesample">hHandle = HttpOpenRequest(hInetConnect, | <pre class="codesample">hHandle = HttpOpenRequest(hInetConnect, "GET", "/document"); | ||
HttpAddRequestHeaders(hHandle | HttpAddRequestHeaders(hHandle "Accept-Language:en-us\r\n"); | ||
HttpSendRequest (hHandle); | HttpSendRequest (hHandle); | ||
InternetReadFile (hHandle, lpBuffer); | InternetReadFile (hHandle, lpBuffer); |
Latest revision as of 13:52, 21 July 2020
Article ID: 251215
Article Last Modified on 6/24/2004
APPLIES TO
- Microsoft Active Server Pages 4.0
- Microsoft Internet Information Services 5.0
- Microsoft Windows Internet Services (WinInet)
This article was previously published under Q251215
SYMPTOMS
When you use the Accept-Language header and the file name specified does not include the file extension, the following error message occurs:
CAUSE
Because no other "Accept:" headers are specified, the Web server determines that the client can only handle text/plain and text/html content types. Because the document has no extension, the type is octet/stream, which causes the error message to be returned. This is by design.
RESOLUTION
Include the file extension in the request, so that the content type can be determined.
MORE INFORMATION
Steps to Reproduce Behavior
The following portion of code causes the Error 406:
hHandle = HttpOpenRequest(hInetConnect, "GET", "/document"); HttpAddRequestHeaders(hHandle "Accept-Language:en-us\r\n"); HttpSendRequest (hHandle); InternetReadFile (hHandle, lpBuffer);
Additional query words: IIS 5 ASP http akz
Keywords: kberrmsg kbprb kbpending KB251215