For the HTTP functions, it's in the beginning the RESPONSE_HTTP_HEADER of the verbose functions. For example.
select SUBSTRING(RESPONSE_HTTP_HEADER,1,24) from table(qsys2.http_get_verbose('
https://www.google.com'))
00001
{"HTTP_STATUS_CODE":200,
Or you can parse it out using JSON_VALUE.
select JSON_VALUE(RESPONSE_HTTP_HEADER,'$.HTTP_STATUS_CODE') from table(qsys2.http_get_verbose('
https://www.google.com'))
00001
200
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
Date: Thursday, December 12, 2024 at 12:38 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] qsys2.http_post - get http status code
Probably a long shot... but...
Using this function we are wanting to consume a service and then know the
http status code returned before having to interrogate the response.
Is this possible? Obviously not with this function but maybe by using one
of the underlying QSYS.QSQAXIS* srvpgms (like the one wrapped in
qsys2.http_post?
Any info in this array would be appreciated.
the use case is we simply want to loop and retry the consumption multiple
times if a http status 500+ code.
As an Amazon Associate we earn from qualifying purchases.