What is the best way to gather a response from a REST API endpoint and upload to SFTP. Is there a native type support to stream directly from a response to <stream>byte[], which is needed for an SFTP client?
Uploading a REST API response to an SFTP server in Ballerina
42 views Asked by Shammi Kolonne At
1
There's a couple of ways to achieve this,
getByteStream()method of theballerina/httpmodule to get the request payload as a stream ofbyte[].targetTypeparameter of http resource call functionApart from the above, if there is no strict requirement to upload to the SFTP server as
stream<byte[]>, you can get a json response from the http client and store it directly.