CURL equivalent in Servoy

Questions and answers on developing, deploying and using plugins and JavaBeans

CURL equivalent in Servoy

Postby garroyo » Sun Feb 27, 2022 7:39 pm

Hi all.

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 --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 = ""; // --- Entorno pruebas.
      var _request
      var _poster = plugins.http.createNewHttpClient();
      _request = _poster.createPostRequest(urlServer);
      var f = plugins.file.convertToJSFile(myXml);
      _request.addHeader("Content-Type", "application/xml;charset=UTF-8");

           var _response = _request.executeRequest()

If someone could tell me how I can adapt it to run on Servoy, I would appreciate it.
Posts: 14
Joined: Mon Jan 23, 2017 2:01 pm

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 4 guests