Page 1 of 1

how to use pre-emptive authentication

Posted: Fri Nov 24, 2023 8:42 pm
by Herbie1220
Hello,

what is the correct way to use the "http_url_post_xml" function including "pre_emptive authentication"?

i use the functions in this order:

http_debug
https_init
http_long_parseURL
http_url_post_xml

can anybody help me?

greatings from vienna
herbie

Re: how to use pre-emptive authentication

Posted: Sat Nov 25, 2023 6:08 am
by Scott Klement
  • You only need to call https_init() if you need to set non-default options for SSL/TLS.
  • I can't see why you'd ever call http_long_parseURL?
  • http_url_post_xml() is very old school. I would recommend updating to http_req or http_string and then using RPG's built-in XML capabilities.
  • Preemptive BASIC auth is done by calling http_setAuth() prior to the transaction.
http_debug -- if needed.
http_setAuth
http_req
XML-INTO/XML-SAX if doing XML. DATA-INTO/DATA-GEN otherwise.