I would be very grateful for any help that can help me solve this problem.
From the Excel VBA code, I need to download and analyze the CSV file from the https://redmine.itransition.com/ website . I am trying to use WinHTTP to get a file. However, I cannot understand why authentication does not work. Here is a snippet of related code:
TargetURL = "https://redmine.itransition.com/projects/pmct/time_entries.csv"
Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")
HTTPReq.Option(4) = 13056 ' WinHttpRequestOption_SslErrorIgnoreFlags 13056: ignore all err, 0: accept no err
HTTPReq.Open "GET", TargetURL, False
HTTPReq.SetCredentials "UN", "PW", 0
HTTPReq.send
returns the following response (only certain lines are listed):
Content-Type: text/html; charset=utf-8
Status: 406
X-Runtime: 5
However, if I sent the cookie string from the Firefox cookie after successful authentication manually using
HTTPReq.setRequestHeader "Cookie", SetCookieString
HTTPReq.send
. , WinHTTP. , , . , .SetClientCertificate, - ?
, : WinHTTP, , , / ? 2 MSDN , .
!