Forum Discussion
Passing a Parameter to Authorization header
- Anonymous2 years ago
Hi shuhn1229 ,
Please try concatenate the type of authorization (e.g., "Basic") with the parameter that contains your password or token.let Var1 = "YourPasswordOrTokenHere", // Replace with your actual password or token AuthorizationHeader = "Basic " & Var1, url = "https://url.com", body = "{""id"": ""0001"", ""variables"": {""variable"": ""001""}}", Source = Json.Document(Web.Contents(url, [ Headers = [#"Authorization"=AuthorizationHeader, #"Content-Type"="application/json"], Content = Text.ToBinary(body) ])) in SourcePlease note that if you're using Bearer token authentication, the header should be prefixed with "Bearer" instead of "Basic".
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi shuhn1229 ,
Please try concatenate the type of authorization (e.g., "Basic") with the parameter that contains your password or token.
let
Var1 = "YourPasswordOrTokenHere", // Replace with your actual password or token
AuthorizationHeader = "Basic " & Var1,
url = "https://url.com",
body = "{""id"": ""0001"", ""variables"": {""variable"": ""001""}}",
Source = Json.Document(Web.Contents(url, [
Headers = [#"Authorization"=AuthorizationHeader, #"Content-Type"="application/json"],
Content = Text.ToBinary(body)
]))
in
Source
Please note that if you're using Bearer token authentication, the header should be prefixed with "Bearer" instead of "Basic".
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group