Pargat, There are older routines and newer routines in HTTPAPI. I would recommend using the newer ones if you can, they have a much more streamlined and simple interface. Use the older routines if you need compatibility with older OS versions, including versions of RPG before it supported larger strings. Under the covers, all of the ways of doing POST use the same HTTP POST request. The difference is how they interface to your program. The old methods for POST are: -- http_url_post(): Data to upload comes from a pointer, data received goes to a file in the IFS -- http_url_post_raw(): Data to upload comes from a pointer, received data goes to a callback routine. -- http_url_post_stmf(): Data to upload comes from an IFS file, received data goes to a file. -- http_url_post_raw2(): Callback is used for both the data to upload, and the received data -- http_url_post_xml(): Data to upload comes from a pointer. Data received is parsed by an XML parser, and parsed data is passed to two callbacks. The new methods are: -- http_req(): Works with any operation, including POST. Data to upload can come from a file or a string. Data received also can be a file or string. -- http_string(): streamlined version of http_req(). Input and output are both strings. Errors are sent as *escape messages instead of return codes. -- http_stmf(): streamlined version o http_req() where input/output are both files. Errors are sent as *escape messages. Please do not call HTTPCMDR4 directly, that is only meant for use from the HTTPAPI command object, and I cannot provide support for calling this program directly. Given that you don't want special behavior for errors, http_req() might be easiest. url = ''; rc = http_req('POST': url: *omit: OutputString: *omit: InputString: 'application/json'); the rc will tell you what you got back from the server. -1 = error occurred, communications didn't succeed 0 = time out 1 = success (same as 200 HTTP code) numbers higher than 1 are HTTP response codes that were sent from the server, such as 404 (not found), 403 (forbidden), 500 (server detected error), etc. If you get a number higher than 0 in the rc, you will also have data in the OutputString (if the server sent any.) Good luck! On 5/3/17 10:35 AM, Pargat Singh wrote:
|
-- _______________________________________________ Ftpapi mailing list Ftpapi@xxxxxxxxxxxxxxxxxxxxxx http://scottklement.com/mailman/listinfo/ftpapi