how to use pre-emptive authentication

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
Herbie1220
Posts: 1
Joined: Fri Nov 24, 2023 3:03 pm

how to use pre-emptive authentication

Post 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
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: how to use pre-emptive authentication

Post 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.
Post Reply