POST form-data with file as body

Forum to discuss the Web client version of Servoy.

POST form-data with file as body

Postby ATrinkunas » Mon Apr 06, 2020 8:17 pm

Hi

Is there way to send POST web request with a file as a form-data (not as binary/octet-stream data) by using plugins.http?

I use following code:

var httpClient = plugins.http.createNewHttpClient();
var request = httpClient.createPostRequest(sUrl);
var r = request.addFile('test', '1.pdf', 'D:\\1.pdf');
var response = request.executeRequest();

Fiddler says that Content-Type: binary/octet-stream

I need to send file as multipart/form-data (Content-type: multipart/form-data;)

Or there is only one way to use Java or it is possible to do it with plugins.http?

Related question: viewtopic.php?f=34&t=21834

We are using currently Servoy 8.4.

Thanks, Anton
ATrinkunas
 
Posts: 5
Joined: Mon Apr 06, 2020 7:52 pm

Re: POST form-data with file as body

Postby sean » Mon Apr 06, 2020 9:40 pm

Hi Anton,

I don't believe the plugin supports that, but most options can be handled with some java.
I believe it was answered in this forum topic:
viewtopic.php?f=34&t=21834
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 4 guests

cron