Datensätze erstellen, ändern und löschen.
Sub NeuerKunde() Dim http As Object Dim url As String Dim body As String url = "http://localhost:5000/api/v1/dsn/demo/tables/Customers" body = "{""Name"":""Neue Firma GmbH"",""Country"":""Germany""}" Set http = CreateObject("MSXML2.XMLHTTP") http.Open "POST", url, False http.setRequestHeader "Content-Type", "application/json" http.send body If http.Status = 200 Then MsgBox "Erfolgreich angelegt!" Else MsgBox "Fehler: " & http.responseText End If End Sub
Sub UpdateKunde() Dim body As String body = "{""primaryKey"":{""Id"":42},""fields"":{""Name"":""Aktualisiert""}}" http.Open "PUT", url, False http.setRequestHeader "Content-Type", "application/json" http.send body End Sub
Sub DeleteKunde() http.Open "DELETE", url & "?Id=42", False http.send End Sub