senden Ich kann nicht unserstand, was ich falsch mache, aber wenn ich nächste Anfrage mit curl schicke, erhalte ich Fehler:ArangoDB nicht Anfrage mit curl
echo {"id":1,"question":"aaa"},{"id":2,"question":"bbb?"} | curl -X POST --data-binary @- --dump - http://localhost:8529/_db/otest/_api/document/?collection=sitetestanswers
HTTP/1.1 100 (Continue)
HTTP/1.1 400 Bad Request
Server: ArangoDB
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
Content-Length: 100
{"error":true,"errorMessage":"failed to parse json object: expecting EOF","code":400,"errorNum":600}
Irgendwelche Ideen? Ich band wickeln es ist [
... ]
. Nichts hilft nicht. Mit [
... ]
Validator Marke diese als gültig
Same mit D. Dies ist mein Code:
void sendQuestionsToArangoDB(Json questions)
{
string collectionUrl = "http://localhost:8529/_db/otest/_api/document/?collection=sitetestanswers";
auto rq = Request();
rq.verbosity = 2;
string s = `{"id":"1","question":"foo?"},{"id":2}`;
auto rs = rq.post(collectionUrl, s, "application/json");
writeln("SENDED");
}
-
POST /_db/otest/_api/document/?collection=sitetestanswers HTTP/1.1
Content-Length: 37
Connection: Close
Host: localhost:8529
Content-Type: application/json
HTTP/1.1 400 Bad Request
Server: ArangoDB
Connection: Close
Content-Type: application/json; charset=utf-8
Content-Length: 100
100 bytes of body received
Für DI diese lib verwenden: https://github.com/ikod/dlang-requests Same Problem mit Vibed.
Zeigen Sie den curl Befehl, zumindest (sollte in DB angelegt werden)! Und reduzieren Sie es auf das erforderliche Minimum, um das Problem zu reproduzieren - ich kann nicht einmal so lange auf meinem Telefon scrollen. –
Können Sie Ihre Antwort als "akzeptiert" markieren, wenn das Problem für Sie behoben wurde? – dothebart