I am trying to connect to a web site and make an OPTIONS request. I am not sure if I can or how to set the HTTP verb I want to use, in this case OPTIONS
My example is:
https://websitename/Microsoft-Server-ActiveSync?User=mailtest HTTP/1.1 with the following Headers
User-Agent:string
Authorization:Basic username and password as a Base64 string
I can get this done in Fiddler Web Debugger and get a 200 response but I am having trouble getting this done in Winbatch.
I have set the Headers and url and then used iBegin, iHostConnect and iHTTPInit without getting any errors but when i use iHttpOpen i am receiving an error.
Could this be a job for the WINHTTP object instead?
Here are some tech article that might help:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/How~To+HTTP~Authentication.txt
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/WinHttpRequest+Sending~an~API-Key~using~WinHttp.txt
Thanks for the article links - the base64 from clear text UDF will be very helpful. I guess my issue appears to be the iHttpInit function only accepts two verbs, GET and POST and I need to send OPTIONS. I will explore the WinHttp options further.
Ah now I think I understand. You may want to take a look at the WinInet function iOptionSet. It allows your to specify the
user_agent: User Agent for HTTP transfers
username: Server authentication required. Username for iHostConnect
password: Server authentication required. Password for iHostConnect
I was able to get it to work using snippets from the second of your two links. Using the WinHtttp object allowed me to send a properly formatted OPTIONS request along with the necessary Headers and I was able to return the response headers to Winbatch. Thanks for all your help. In a nutshell I was trying to connect and verify that a Microsoft Exchange Server's Active Sync (EAS) was listening and responding appropriately.