简体   繁体   中英

DynamoDB Local throws http 400 bad request

I am trying to run dynamo db local released by AWS a week ago through .net sample provided by amazon.

 AmazonDynamoDBConfig config = new AmazonDynamoDBConfig();
 config.ServiceURL = "http://localhost:8000";
 client = new AmazonDynamoDBClient(config);

 Console.WriteLine();
 Console.WriteLine("Creating sample tables");
 CreateSampleTables();



 public static void CreateSampleTables()
 {
    Console.WriteLine("Getting list of tables");
    //This line throws error
    List<string> currentTables = client.ListTables().ListTablesResult.TableNames; 

Exception of type 'Amazon.DynamoDB.AmazonDynamoDBException' was thrown.

Inner exception: {"The remote server returned an error: (400) Bad Request."}

I tried to call localhost:8000 using the browser, and I get the same error

This error (HTTP 400 Bad Request) means that Internet Explorer was able to connect to the web server, but the webpage could not be found because of a problem with the address.

Any help would be greatly appreciated!

Without seeing all your code, my initial guess is that you are still using the Amazon.DynamoDB namespace and not the Amazon.DynamoDBv2 namespace. The Amazon DynamoDB Local tool only supports the latest DynamoDB API.

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM