HTTP_STMF PUT
Posted: Wed Sep 14, 2022 2:53 am
Good evening.....
I am using HTTP_STMF to PUT .csv's to AWS' S3 buckets.
The issue I am having involves the parameters. Note: Trailing portion of the URL is the file name. Per AWS.
In my RPG if I "DCL-S URL Char(124);" the process works fine since my complete url is 124 characters.
If I make URL any larger, I get %20%20%20 placed on the end, making the URL invalid when it reaches AWS.
Having similar issue with the send file name in the 4th parameter. If my field length on the declare is not the exact length of the file name, I get No such Path in the response.
My naming convention is such that i can get by with having my field lengths exact, but I'm fearful I will eventually need to make them variable.
Dcl-PR WSAWS_RO;
*n Char(250);
End-PR;
Dcl-PI WSAWS_RO;
pIFSFileName Char(250);
End-PI;
Dcl-S url char(124);
Dcl-S IFSRcv char(5000);
Dcl-S IFSSnd char(38);
url = 'https://XXXXXXXXXX.execute-api.us-west-2.amazonaws.com/' +
'xxxxxxxxx/xxxxxxxxfulfillorder-mytools/' + %Trim(pIFSFileName);
IFSRcv = '/AWS_S3/WORKFILE.TXT';
IFSSnd = '/AWS_S3/' + %Trim(pIFSFileName);
http_stmf('PUT':url:IFSRcv:IFSSnd:'text/csv');
Any help appreciated.
Chris
I am using HTTP_STMF to PUT .csv's to AWS' S3 buckets.
The issue I am having involves the parameters. Note: Trailing portion of the URL is the file name. Per AWS.
In my RPG if I "DCL-S URL Char(124);" the process works fine since my complete url is 124 characters.
If I make URL any larger, I get %20%20%20 placed on the end, making the URL invalid when it reaches AWS.
Having similar issue with the send file name in the 4th parameter. If my field length on the declare is not the exact length of the file name, I get No such Path in the response.
My naming convention is such that i can get by with having my field lengths exact, but I'm fearful I will eventually need to make them variable.
Dcl-PR WSAWS_RO;
*n Char(250);
End-PR;
Dcl-PI WSAWS_RO;
pIFSFileName Char(250);
End-PI;
Dcl-S url char(124);
Dcl-S IFSRcv char(5000);
Dcl-S IFSSnd char(38);
url = 'https://XXXXXXXXXX.execute-api.us-west-2.amazonaws.com/' +
'xxxxxxxxx/xxxxxxxxfulfillorder-mytools/' + %Trim(pIFSFileName);
IFSRcv = '/AWS_S3/WORKFILE.TXT';
IFSSnd = '/AWS_S3/' + %Trim(pIFSFileName);
http_stmf('PUT':url:IFSRcv:IFSSnd:'text/csv');
Any help appreciated.
Chris