× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You can also use http_req(). It allows you to specify the type of request (i.e. POST) and independently select whether your payload and response is a variable or streamfile.

rc = http_req('POST'
: URL
: '/myifsFile'
: *omit
: *omit
: jsonBodyRPGvariable
: 'application/json');

Here is the prototype descriptions from RDI:

http_req( Type VARCHAR(10: 2) CONST:
URL VARCHAR(32767: 2) CONST:
ResultStmf VARCHAR(5000: 2) CONST OPTIONS(*OMIT: *VARSIZE):
ResultStr VARCHAR(16000000: 4) OPTIONS(*NOPASS: *OMIT: *VARSIZE):
SendStmf VARCHAR(5000: 2) CONST OPTIONS(*NOPASS: *OMIT: *VARSIZE):
SendStr VARCHAR(16000000: 4) CONST OPTIONS(*NOPASS: *OMIT: *VARSIZE):
ContentType VARCHAR(16384: 2) CONST OPTIONS(*NOPASS: *OMIT: *VARSIZE)
) http_req : INT(10) EXTPROC ( 'HTTP_REQ' )

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of (WalzCraft) Jerry Forss
Sent: Tuesday, September 01, 2020 4:24 PM
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: http_post

I have a json doc (jsonRequest) on the ifs but am having trouble sending it with the http_post.
I am unsure what to put into parameters 2 and 3.

The examples I am finding online use a variable from the pgm.

rc = http_post( URL
: %addr( WhatdDoIPutHere : *data )
: %len( WhatdDoIPutHere )
: 'IFS/jsonRequest.json'
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'application/json' );



Subject to Change Notice:

WalzCraft reserves the right to improve designs, and to change specifications without notice.

Confidentiality Notice:

This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only" pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You

WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<http://www.walzcraft.com> Phone: 1-800-237-1326

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.