New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have an SDK request problem #54
Comments
Enable |
|
Below example works fine. Purely your local issue. #include "client.h"
int main(int argc, char* argv[]) {
// Create S3 base URL.
minio::s3::BaseUrl base_url("localhost:9000", false);
// Create credential provider.
minio::creds::StaticProvider provider(
"minioadmin", "minioadmin");
// Create S3 client.
minio::s3::Client client(base_url, &provider);
client.Debug(true);
// Create make bucket arguments.
minio::s3::MakeBucketArgs args;
args.bucket = "my-bucket";
// Call make bucket.
minio::s3::MakeBucketResponse resp = client.MakeBucket(args);
// Handle response.
if (resp) {
std::cout << "my-bucket is created successfully" << std::endl;
} else {
std::cout << "unable to create bucket; " << resp.Error().String()
<< std::endl;
}
return 0;
} * STATE: INIT => CONNECT handle 0x1fdb5c8; line 1837 (connection #-5000)
* Added connection 0. The cache now contains 1 members
* family0 == v4, family1 == v6
* Trying 127.0.0.1:9000...
* STATE: CONNECT => CONNECTING handle 0x1fdb5c8; line 1898 (connection #0)
* Connected to localhost (127.0.0.1) port 9000 (#0)
* STATE: CONNECTING => PROTOCONNECT handle 0x1fdb5c8; line 2030 (connection #0)
* STATE: PROTOCONNECT => DO handle 0x1fdb5c8; line 2053 (connection #0)
> PUT /my-bucket HTTP/1.1
Host: localhost
Accept: */*
Authorization: AWS4-HMAC-SHA256 Credential=minioadmin/20221031/us-east-1/s3/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=066921d3d9cfa1b6ac47b29b8c882e2aae6cdc87b4403b71ae4cbbefd3d4d4b4
Content-Length: 0
Content-Type: application/octet-stream
User-Agent: MinIO (Linux; x86_64) minio-cpp/0.1.0
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date: 20221031T045739Z
* STATE: DO => DID handle 0x1fdb5c8; line 2149 (connection #0)
* STATE: DID => PERFORMING handle 0x1fdb5c8; line 2268 (connection #0)
* Mark bundle as not supporting multiuse
* HTTP 1.1 or later with persistent connection
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Content-Length: 0
< Content-Security-Policy: block-all-mixed-content
< Location: /my-bucket
< Server: MinIO
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Vary: Origin
< Vary: Accept-Encoding
< X-Amz-Request-Id: 17230E86DA7234A6
< X-Content-Type-Options: nosniff
< X-Xss-Protection: 1; mode=block
< Date: Mon, 31 Oct 2022 04:57:39 GMT
<
* STATE: PERFORMING => DONE handle 0x1fdb5c8; line 2467 (connection #0)
* multi_done: status: 0 prem: 0 done: 0
* Connection #0 to host localhost left intact
* Expire cleared (transfer 0x1fdb5c8)
my-bucket is created successfully |
Looks like you have a proxy here @xiaonaiquan |
Hi,I have an SDK request problem,I use the following code, return “MakeBucket(): invalid response received; status code: 400; content-type: text/xml; charset=utf-8”,You know why?
code:
minio::s3::MakeBucketArgs args1;
args1.bucket = "test";
minio::s3::MakeBucketResponse resp1 = client.MakeBucket(args1);
if (!resp1)
{
throw std::runtime_error("MakeBucket(): " + resp1.Error().String());
}
The text was updated successfully, but these errors were encountered: