Yes, that is exactly what I was looking for. Thank you very much.

Best regards


Am 25. Februar 2019 23:54:16 MEZ schrieb Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>:
Hi Mihael,

The 2nd parameter to http_error() will give you the http response code
if that's what you need?

http_error(*omit: myCode);

if (myCode = 404);

   dsply 'got 404 not found';


Is that what you're looking for?

Alternately, If you change your logic to use http_req() instead of
http_string(), http_req() will directly return the code for anything
besdies 200.  (200 means success).

myCode = http_req(...parameters...);

if myCode = 404;

   dsply 'got 404 not found';



On 2/25/2019 3:16 AM, Mihael wrote:

I am using Scott's HTTPAPI to make a request and that works fine. But
how do I get the HTTP status of the last request? I am using
http_string to make the request.

Thanks in advance.

This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

This thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].