I have a Question for angular 5. I become an API Call to make this over angular but I become always a bad request from the API IIS Server.
This is the String
`With the Methode POST
First you should not use string as a variable name because it is a type in typescript and therefore is a restricted word. Usually the compiler should tell you this is an error.
let body = `{"Befehl": "${sqlstring}","Datenbank": "DBScharnsteinTest", "Login": "username", "Passwort": "password", "PKMitarbeiterID": "2640"}`;
Second I would combine the Headers in one assignment:
let headers = new HttpHeaders({
'Content-Type': 'application/json',
'Accept': 'text/javascript'
});
Third you use console.log() without something to log out. You can use a combination of text and variables like this way: console.log('POST: ', body);
Yes I am speaking german. But we should not communicate in german in the thread. If your english is not that good and you prefer to speak in german, you can send me a private message. But for the community it would be better to stay with english and solve the problem in this thread .