ich eine Locke, die wie folgt aussieht:Übersetzen curl zu Knotenanforderung
curl -X "POST" "https://theEndpoint.com" \
-H "Authorization: Basic theEncodedUserName/Password" \
-H "Content-Type: application/json" \
-d "{\"GETRSDATA_Input\":{\"@xmlns\":\"http://theEndpoint.com\",\"RESTHeader\":{\"@xmlns\":\"http://theEndpoint.com/header\"},\"InputParameters\":{\"P_CHANGESINCE_DATE\":\"0460070398\"}}}"
Ich bin mit dem request Modul in meiner ausdrücklichen App wie folgt aus:
var options = {
method: 'POST',
url: 'https://theEndpoint.com',
headers: {
'Authorization': 'Basic theEncodedUserName/Password',
'Content-Type': 'application/json',
},
multipart: [{
'content-type': 'application/json',
body: JSON.stringify({"GETRSDATA_Input":{"@xmlns":"http://theEndpoint.com","RESTHeader":{"@xmlns":"http://theEndpoint.com/header"},"InputParameters":{"P_CHANGESINCE_DATE":"0460070398"}}})
}],
Ich habe eine Callback-Funktion die Antwort zu handhaben und ich laufe es mit:
request(options, callback);
Does das sieht richtig aus? Ich glaube nicht, dass ich die Anfrage richtig aufstelle.