IServerXMLHTTPRequest を使用して HTTPS サーバーにアクセスする C++ アプリケーションを実装しようとしています。
私の現在のコードは次のとおりです。
CComPtr<MSXML2::IServerXMLHTTPRequest> xmlHttp;
HRESULT hr = xmlHttp.CoCreateInstance(__uuidof(ServerXMLHTTP));
hr = xmlHttp->open(_T("POST"),_T("https://someurl.com/somepath"),false);
hr = xmlHttp->setTimeouts( 100000,
50000,
100000,
100000
);
hr = xmlHttp->setOption(SXH_OPTION_SELECT_CLIENT_SSL_CERT,
xmlHttp->getOption(SXH_OPTION_SELECT_CLIENT_SSL_CERT));
hr = xmlHttp->setRequestHeader(_T("Content-Type"),_T("application/x-www-form-urlencoded"));
sPostData = ...;
hr = xmlHttp->send((BSTR)sPostData);
上記のコードを実行しようとすると、サーバーが 403 (禁止) エラーを返します。
これの原因は何ですか?そして、私はこれについて何をすべきですか?