I'm having difficulty trying to figure out the proper way to interface with the http_string() api and passing in a varying json string. I have the following field definitions:
Here is my execution of http_string():
After executing this code and logging the http_string() request, the json object opening curly bracket ('{') is missing and there are two extra spaces at the end of the json request.
Code:
dcl-s jsonRequest varchar(65535); dcl-s jsonRequestLength int(10);
Code:
%len(jsonRequest) = 65535; // could not find a solid example of how changing the len of the request is supposed to work rc = yajl_copyBuf( 0 : %addr(jsonRequest) : %size(jsonRequest) : jsonRequestLength ); %len(jsonRequest) = jsonRequestLength; yajl_genClose(); http_debug( *ON : debugFileName ); http_setOption('network_ccsid': '1208'); http_xproc( HTTP_POINT_ADDL_HEADER : %paddr(addAuthOnly) ) monitor; callp http_string( 'POST' : serviceUrl : jsonRequest : 'application/json' ); on-error; // handle error end-mon; http_debug( *OFF : debugFileName );
Comment