DWORD dwStatus; CString strStatus; pFile->SendRequest(); pFile->QueryInfoStatusCode(dwStatus); // Status Number - eg 200, 404 pFile->QueryInfo(HTTP_QUERY_STATUS_TEXT, strStatus); // Status String - eg OK, Not Found pFile->QueryInfo(HTTP_QUERY_CONTENT_TYPE, strContentType); // Content-Type - eg text/htmleg dwStatus = 404, strStatus = "Not Found"
Programming Tips - MFC: How can I get the status code and status text from an CHttpFile?
Date: 2019mar13
Framework: MFC
Language: C/C++
Q. MFC: How can I get the status code and status text from an CHttpFile?
A. After SendRequest() you can use QueryInfoStatusCode() and QueryInfo()