0

MinIO is returning a general exception when calling the API from a .net client. In the library parsing the xml fails telling me that "Client calls PutObjectAsync General Exception 'doctype' is an unexpected token. The expected token is 'DOCTYPE'" which is no help at all.

MinIO Version 2021-09-09T21:37:07Z

Uploading objects using the webconsole works as expected.

1 Answers1

0

Can you share an example of the code you are using? Please make sure you are using the S3 endpoint (running on port 9000 by default) and not the console-ui endpoint (9090 by default).

Here is a simple example of how to use the .net library to connect to the MinIO running on https://play.min.io:9000.

using Minio;

// Initialize the client with access credentials.
private static MinioClient minio = new MinioClient("play.min.io",
                "Q3AM3UQ867SPQQA43P2F",
                "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
                ).WithSSL();

// Create an async task for listing buckets.
var getListBucketsTask = minio.ListBucketsAsync();

// Iterate over the list of buckets.
foreach (Bucket bucket in getListBucketsTask.Result.Buckets)
{
    Console.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);
}

Please read more at https://docs.min.io/docs/dotnet-client-quickstart-guide.html

Alevsk
  • 37
  • 1
  • 9