ArangoDB:名称必须为非空

时间:2016-05-02 17:57:01

标签: d arangodb vibed

当我在浏览器中打开页面时,我得到了:

{"id":"786938997027","name":"users","isSystem":false,"status":3,"type":2,"error":false,"code":200}

当我从代码发送请求时,我得到下一个输出:

Response: {"error":true,"code":400,"errorNum":1208,"errorMessage":"name must be non-empty"}

怎么了?

void foo()
{
    string url = "http://localhost:8529/_db/testdb/_api/collection/users"; 
    import std.experimental.logger;
    globalLogLevel(LogLevel.info);

    Json users;

    requestHTTP(url,
        (scope req) {
            req.method = HTTPMethod.POST; 
        },
        (scope res) {
            logInfo("Response: %s", res.bodyReader.readAllUTF8());
            users = res.bodyReader.readAllUTF8();
        }
    );
}

1 个答案:

答案 0 :(得分:1)

你需要使用GET类型的请求作为@Colonel Thirty Two提到。所以删除这一行:

req.method = HTTPMethod.POST;

或将其更改为:

req.method = HTTPMethod.GET;