Forum Discussion
Managing cookies
Hi Anonymous
The authorization should be specified as #"Authorization" . Try this
Cookies= Web.Contents("https://domain/api/cookie", [Headers=[#"Authorization"= "Bearer "&Access_Token("password", "token", "code")[access_token], #"Content-Type"="application/json"]])
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Hi PhilipTreacy
Thanks for the reply.
Unfortunately, changing it to #"Authorization" did not make any difference. I'm still receiving the same error. The error is actually from the API call to our systems:
= Web.Contents("https://domain/api/systems", [Headers =[#"Authorization"= "Bearer "&Access_Token("password", "token", "code")[access_token], Cookie="CookiesResponse", #"Accept"="application/json", #"Accept-Encoding"="gzip, deflate, br"]])
Though I'm trying to send cookies here, it still asks me for sign in credentials which shouldn't be the case. I feel like the cookies are not being accepted maybe because they are not in right format or something. As a result for cookies, I get the domain as result in power query(example abc.domain.com) and if I try opening it in any format like Json, CSV, HTML etc it has nothing.
Cookies are returning results with both Authorization and #"Authorization". Don't we use #"" if there is any space in the name. Example Authorization-sample becomes #"Authorization-sample".
- Anonymous5 years agoNot applicable
Does anyone have an idea on how Power BI works with cookies. I've tried sending the CookieResponse, yet it still doesn't seem to work.