zur Zeit habe ich eine api, in dem Sie eine json und die api Antwort senden: die json i senden: { "instructions": [ { "A": 9, "B": 1, "move": "moveonto" }, { "A": 8, "B": 1, "move": "moveover" } ], "length": 20, "res": "null" }
Gebäude JSON-String in Winkel von Form
und die api Antwort: { "instructions": [ { "A": 9, "B": 1, "move": "moveonto" }, { "A": 8, "B": 1, "move": "moveover" } ], "length": 20, "res": "Position [0] : 0Position [1] : 1 9 8Position [2] : 2Position [3] : 3Position [4] : 4Position [5] : 5Position [6] : 6Position [7] : 7Position [8] : Position [9] : Position [10] : 10Position [11] : 11Position [12] : 12Position [13] : 13Position [14] : 14Position [15] : 15Position [16] : 16Position [17] : 17Position [18] : 18Position [19] : 19" }
im a Entwicklung sehr einfache Webseite: wenn ich auf die Schaltfläche zum Senden an den Server klicken muss ich es senden, das Problem ist, ich weiß nicht, wie man den JSON bauen, können Sie mir helfen? thx
ich habe leichte Idee:
Json = {
"instructions": [{
"A": $scope.addA,
"B": $scope.addB,
"move": $scope.addMov
}, {
"A": $scope.addA,
"B": $scope.addB,
"move": $scope.addMov
}],
"length": $scope.blockLength,
"res": null
};
und ich es senden:
$http.post("http://localhost:56493/api/BlocksProblem", Json)
.then(function (data) {
$scope.result = data;
}, function (response) {
$scope.result = response;
});
Vielen Dank für Ihre Zeit durch alle es lesen.
erhalten Sie einen Fehler? – Coder