How to pass authentication credentials in VBA

前端 未结 3 825
庸人自扰
庸人自扰 2020-12-10 16:31

I\'m trying to write a VBA macro that would pass my credentails to an address and fetch some content (REST API for JIRA), but I\'m having some difficulties converting my cod

3条回答
  •  粉色の甜心
    2020-12-10 17:29

    For Basic Authentication you can simply:

    Dim response As String
    
    With CreateObject("Microsoft.XMLHTTP")
      .Open "GET", address, false, username, password
      .Send
      response = .responseText
    End With
    
    Msgbox response
    

提交回复
热议问题