AWS S3 aws-sdk-cpp GetObject "Unable to connect to endpoint"
AWS S3 aws-sdk-cpp GetObject "Unable to connect to endpoint"
我正试图使用aws-sdk-cpp从S3获取一个对象,但出现了"错误。我成功地直接从web浏览器访问了该文件。
这是我的代码:
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);"等待多时返回错误!!!错误:"无法连接到端点"
我缺少什么?
Region在ClientConfiguration中丢失!所有需要添加的是:
config.region = REGION;
我也遇到过这个问题。我用解决了这个问题
config.region = Aws::Region::EU_CENTRAL_1;
config.scheme = Aws::Http::Scheme::HTTPS;
config.connectTimeoutMs = 30000;
config.requestTimeoutMs = 600000;
相关文章:
- "error: no matching function for call to"构造函数错误
- 调用专用模板时出错"no matching function for call to [...]"
- C++ Singleton - Prevent ::instance() to variable
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- Visual Studio Code "undefined reference to `WinMain@16'"
- 使用 GCC 卸载的 OpenMP 卸载失败,并出现"Ptx assembly aborted due to errors"
- 如何解决"invalid conversion from 'char' to 'const char*'"
- 使用 MATLAB 编码器生成C++代码:编译错误"undefined reference to `rgb2gray_tbb_real64'"
- 尝试链接我的着色器时,我收到错误代码"error c5145 must write to gl_position"
- Python str to C++ to Python str
- 为什么创建友元类的实例会导致"undefined reference to"错误?
- SDL_Init失败并显示'SDL_Error: Failed to connect to the Mir Server'
- AWS 批处理"unable to connect to endpoint"
- QObject::connect not connecting signal to slot
- AWS S3 aws-sdk-cpp GetObject "Unable to connect to endpoint"
- qt dialog2 connect dialog1 to updateQtableWidget
- Connect to Wi-Fi C++
- ScopedDbConnection 偶尔抛出"Couldn't connect to 127.0.0.1",可能的原因?
- Qt C++ Connect QSlider to QWebView's setTextSizeMultiplier
- Connect to Gtk::Window signal_delete_event