Forum Discussion

natolira's avatar
natolira
Frequent Visitor
9 years ago

Power query using post method with windows authentication

Hello. I have a macro that extract some content form an intranet, but I´m having trouble to implement the same solution using M.

 

The part of the vba code that matters is:

---------------------

Parameter = "MyParameter"
Url = "MyURL"

 

With CreateObject("MSXML2.XMLHTTP.6.0")
  .Open "POST", Url, False
  .setRequestHeader "User-Agent", "mozilla/4.0 (compatible; MSIE 6.0)"
  .setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"
  .send Parameter
  txt = .responsetext
End With
Set objXmlHttp = Nothing
text = Split(txt, Chr(10))

-----------

 

and then I have the data I need in txt format....

 

Anyone can help me to get the same data using Power Query?

5 Replies

  • natolira's avatar
    natolira
    Frequent Visitor

    Hello. I have a macro that extract some content form an intranet, but I´m having trouble to implement the same solution using M.

     

    The part of the vba code that matters is:

    ---------------------

    Parameter = "MyParameter"
    Url = "MyURL"

     

    With CreateObject("MSXML2.XMLHTTP.6.0")
      .Open "POST", Url, False
      .setRequestHeader "User-Agent", "mozilla/4.0 (compatible; MSIE 6.0)"
      .setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"
      .send Parameter
      txt = .responsetext
    End With
    Set objXmlHttp = Nothing
    text = Split(txt, Chr(10))

    -----------

     

    and then I have the data I need in txt format....

     

    Anyone can help me to get the same data using Power Query?

  • Hi, did you ever figure out how to POST data using Windows Credentials to an API?  GET seems to be supported but not POST.  Any help would be appreciated as it's driving me nuts!  Regards, Steve