How can I translate this curl command to Servoy with the http.plugin ?
- Code: Select all
curl --connect-timeout 60 -m 60 -s -S -L --header "Content-Type: application/xml;charset=UTF-8" -H "Accept: application/xml" --cert certificate.pem --key certificate_key.pem --data TBAI2209713_firma.xml https://tbai-prep.egoitza.gipuzkoa.eus/WAS/HACI/HTBRecepcionFacturasWEB/rest/recepcionFacturas/alta --output salida.xml -v
I have read I must import my certificate in .crt format to cacerts, but then it is not clear how I could create a POST to the URL by passing the file I want with the certificate and its key.
Something similar to this code but I can't get it to complete or run
- Code: Select all
var urlServer = "https://tbai-z.prep.gipuzkoa.eus/sarrerak/alta"; // --- Entorno pruebas.
var _request
var _poster = plugins.http.createNewHttpClient();
_request = _poster.createPostRequest(urlServer);
var f = plugins.file.convertToJSFile(myXml);
_request.addFile(null,f.getName(),f)
_request.addHeader("Content-Type", "application/xml;charset=UTF-8");
_request.setCharset('UTF-8');
var _response = _request.executeRequest()
If someone could tell me how I can adapt it to run on Servoy, I would appreciate it.