String and file in pub.client:http

hi guys,
i need help to put string and file from sftp to pub.client:http like in the picture below, but the service seemed only to read just the string not the file.

The children of data/args are name/value pairs. From the docs:

To specify data using args , create one String
element for each name/value pair that you want to

A byte array cannot be passed. If you’re trying to send parameters in the URL, and the file content as the HTTP body, then map the stream of the open file to data/stream. From the docs:

You can use stream to submit data via the POST,
PUT, or PATCH methods only.

Important: When you use stream and another element
(args , table , string or bytes ) to specify data, the
service appends the data from the args , table ,
or string element to url . The service appends
args to url first, table second, and string last.
The service encodes the data from the stream
element in the body of the post.

Be sure to set the Content-Type to appropriate value, which looks like you may be doing since headers looks to have something defined in your screen shot.

The names of the vars in data/args seem a bit odd – method and data seems like there may be confusion about setting the right inputs. Can you share the values being set there?


the values that need to be send is like on the picture

Thanks for sharing the Postman screen.

Depending upon what the target you’re calling supports, you can either follow the info shared above (URL parameters, file data as the HTTP body with the appropriate Content-Type header) or you’ll want to review the material for how to send multipart/form-data. Postman is doing some work for you under the covers – you’ll need to replicate that when using pub.client:http.