In Servoy 2023.03.0, I try to send any image to Prestashop 1.7.6.7 with the Http protocol forceHttp1 true, but dosen't work
I use this code:
- Code: Select all
var config=plugins.http.createNewHttpClientConfig();
config.forceHttp1=true;
cliHttp = plugins.http.createNewHttpClient(config);
var postRequest = cliHttp.createPostRequest(url);
postRequest.addHeader('enctype', 'multipart/form-data');
postRequest.addHeader('method', 'POST');
postRequest.addParameter('Content-Disposition', 'form-data;name="image"');
postRequest.addParameter('Content-Type', content);
postRequest.addFile('image', tempFile);
response = postRequest.executeRequest();
result = utils.stringReplace(response.getResponseBody(), "><", ">\n<");
It took a long time to respond and when it does it gives this error:
ERROR com.servoy.j2db.util.Debug - response.getResponseBody API was called while response is null due to request exception: java.net.SocketTimeoutException: 50000 MILLISECONDS
Thanks