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

Best regards

Mihael

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';

endif;

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';

endif;


-SK


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

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.

Mihael
--
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,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


This thread ...

Replies:

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

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