Forum Discussion

usuario221's avatar
usuario221
Frequent Visitor
2 years ago

cant access a web with credentials

hi, im having an issue where i cant access with my credentials to the web, im always getting the html data of the login page even if i change the configuration of the data origin to basic.

 

 i've tried a lot of variations i saw in the forum to try to connect, i checked wireshark and when i connect to the web with the configuration in basic  it never throw a POST, always a GET.

 

Also i found this code and i used it in a blank query and putting the configuration in anonymous but im getting the same result

 

let
url = "web",
#"user" = "xxxxxxxxx", // Username
#"pass" = "xxxxxxxxx", //Password

EncodedCredentials = "Basic " & Binary.ToText(Text.ToBinary(#"user" & ":" & #"pass"), BinaryEncoding.Base64),

Source = Table.FromColumns({Lines.FromBinary(Web.Contents(url, [Headers=[#"Content-Type"="application/x-www-form-urlencoded", Authorization="EncodedCredentials"]]), null, null, 65001)})

in
Source

 

 

 

Thanks for the help!

 

4 Replies

  • Hey usuario221 ,

     

    I'm not an expert at all, when it comes to accessing web data sources. But, when it's not that easy I rely on Postman, maybe you can give it a try.

     

    Regards,

    Tom

    • usuario221's avatar
      usuario221
      Frequent Visitor

      hi, sorry for the slow reply. Postman works fine, i can access the main page with my credentials

  • Brunner_BI's avatar
    Brunner_BI
    Impactful Individual

    PowerQuery by default sends a GET request, the only way that I know you can send a POST request is if you add something to the body of the request.

    • usuario221's avatar
      usuario221
      Frequent Visitor

      hi, sorry for the slow reply but how do i have to modify the code?