http_req with POST and large string
Posted: Tue Jun 20, 2023 7:21 pm
Hello,
I am trying to send a large string using http_req but the receiving side is only getting 64K of the string. Using the same string in Postman results in the whole string arriving OK.
My HTTPAPI version is 1.42. My code snippets are below. The large variable is "body" and is defined as shown.
I am wondering if something with the URL encoded form is causing the data to be truncated?
All variables seem large enough so I am not certain where else to look. I also am not able to see the entirety of the large variable to know for sure if it's OK because STRDBG tops out at 64K to view variables.
I can update to the latest version as well, if needed but was not sure if that was really needed so I did not do that yet.
Anyone have any insights on what I could do to test or what it could be?
Thanks all!
I am trying to send a large string using http_req but the receiving side is only getting 64K of the string. Using the same string in Postman results in the whole string arriving OK.
My HTTPAPI version is 1.42. My code snippets are below. The large variable is "body" and is defined as shown.
Code: Select all
D body s 5000000a varying
formData = 'req_client=' + %trim(clientcode)
+ '&req_uri=' + %trim(url)
+ '&req_method=' + %trim(method)
+ '&req_body=' + %trim(body);
http_setOption( 'content-type'
: 'application/x-www-form-urlencoded' );
rc = http_req( 'POST'
: authURL
: *omit // File to receive
: response // String to receive
: *omit // File to send
: formData ); // String to send
All variables seem large enough so I am not certain where else to look. I also am not able to see the entirety of the large variable to know for sure if it's OK because STRDBG tops out at 64K to view variables.
I can update to the latest version as well, if needed but was not sure if that was really needed so I did not do that yet.
Anyone have any insights on what I could do to test or what it could be?
Thanks all!