我想從S3使用aws-sdk-cpp獲得一個對象,但得到「」錯誤。 我直接從網絡瀏覽器成功訪問文件。AWS S3 aws-sdk-cpp GetObject「無法連接到端點」
這裏我的代碼:
static const char* ALLOCATION_TAG = "App_TransferFiles_TAG";
// Create a client
ClientConfiguration config;
config.scheme = Scheme::HTTP;
config.connectTimeoutMs = 30000;
config.requestTimeoutMs = 30000;
m_s3Client = Aws::MakeShared<S3Client>(ALLOCATION_TAG, config);
TransferClientConfiguration transferConfig;
transferConfig.m_uploadBufferCount = 20;
m_transferClient = Aws::MakeShared<TransferClient>(ALLOCATION_TAG, m_s3Client, transferConfig);
GetObjectRequest getObjectRequest;
getObjectRequest.SetBucket(""MyBucketName");
getObjectRequest.SetKey("My_CONTENT_FILE_KEY");
GetObjectOutcome getObjectOutcome = m_s3Client->GetObject(getObjectRequest);
「m_s3Client-> GetObject的(getObjectRequest);」長時間等待後返回一個錯誤! 錯誤:「無法連接到端點」
我失蹤了什麼?