http_req( but need the http code on failure
Posted: Thu Oct 28, 2021 9:29 pm
This code is working fine. My only problem is when it fails, I cannot capture the HTTP status code, 401 for example.
The gReponse variable contains the text for the reason " {"message":"Invalid username/password."} ". I could force the errors and translate text to error codes, but I would rather not.
And, yes, I have found this so much better than reinventing the wheel. Merci beaucoup, Scott.
The gReponse variable contains the text for the reason " {"message":"Invalid username/password."} ". I could force the errors and translate text to error codes, but I would rather not.
Code: Select all
gResponseCode = http_req(
'POST'
: url
: *OMIT // File to receive
: gResponse // String to receive
: gZipPath // File to send
: *OMIT // gRequest
: 'application/json' );