0

私は現在、もともと私が構築したものではないプロジェクトを扱っています。これは、EFT サーバーに接続するクライアントであり、ボタンをクリックするだけでファイルをアップロードする必要があります。ソフトウェアが構築されていたとき、Apache サーバーでローカルにテストするために構築された資格情報がありませんでした。

GUI は Visual C# を使用して構築され、サービスは libcurl と C++ を使用して構築されます。

fileCurl.cpp というファイルがあり、資格情報を _startUpload クラスに追加しました。

// What URL that receives this POST 
curl_easy_setopt(cFileCurl->mCurl, CURLOPT_URL, sUrl.c_str());
//Username and Password
curl_easy_setopt(cFileCurl->mCurl, CURLOPT_USERPWD, "myname:thesecret");

GUI は JSON を使用して解析され、ホストとポートが取得されます。この後もサーバーは 401 (ユーザー認証エラー) を返します。

これについていくつかの手がかりが必要です。私が残した情報があればお知らせください。すぐに投稿します.

ありがとう

4

1 に答える 1

0

The response headers you got with the 401 contains the info you need, like for example which HTTP authentication methods the server supports for this URL. Your libcurl options there seems to use the default method only which is Basic.

于 2012-05-03T21:48:12.340 に答える