In store-file-service (written in Spring), I have a controller that takes responsibility of storing file via a POST request with request param is "file-param" and the paramter is MultipartFile.
In servoy-app, to send a POST request with the parameterName is "file-param", I have the following code
- Code: Select all
var client = plugins.http.createNewHttpClient();
var poster = client.createPostRequest("http://localhost:8080/api/store-file");
// configure header
poster.addHeader("Content-Type", "multipart/form-data; boundary=any")
// ===
// configure parameter
poster.addFile("file-param", "filename", myJsFile);
// ===
var response = poster.executeRequest();
response.close();
From servoy-app, everything seems to work. But from store-file-service, I got log info
MissingServletRequestPartException: Required part 'file-param' is not present.
This makes me confused because I already declared the parameterName while addFile as "file-param". Is there any wrong with my configuration in servoy-app?
Testing store-file-service with postman works well as expected.