Hi everybody,
probably I am overlooking something, but I can't find how to retrieve the http status code of the last http request I made,
I do a http_string() with 'POST'
and after I do:
hmErrMsg = http_error(hmErrNo: hmRspCode);
hmErrNo and
hmRspCode
are both 10i fields.
hmErrMsg and hmErrNo get the values that I also see in the debug log file (see below).
I understood that hmRspCode would contain the http response code, in this case 401, however the value is 0.
Also, the webservice returns a JSON structure together with the 401 which I don't receive as the result of the http_string() call. I assume HTTPAPI cancels processing after a httpStatus >= 400.
Anybody any suggestions?
Thanks in advance,
Richard
From the log file:
recvresp(): entered
HTTP/1.1 401 Unauthorized
Server: nginx/1.17.8
Date: Fri, 17 Jul 2020 15:11:31 GMT
Content-Type: application/json
Content-Length: 72
Connection: keep-alive
Cache-Control: no-store
X-XSS-Protection: 1; mode=block
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15724800; includeSubDomains
X-Content-Type-Options: nosniff
SetError() #13: HTTP/1.1 401 Unauthorized
recvresp(): end with 401
recvdoc parms: identity 72
SetError() #36: This page requires a user-id & password
AuthPlugin_mustReceiceAuthErrorPage(): entered
http_close(): entered