Forum Discussion

adarshmadrecha's avatar
adarshmadrecha
Regular Visitor
8 years ago
Solved

Passing Cookie using Web.Contents in PowerBI Desktop

I have API which authenticates user based on Cookies (PHP Sessions)

 

I am using below code to pass cookies

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID:123abc"]]))

But the above code does not work.

Can you please help in finding out what I am doing wrong?

  • I understood waht the issue was.

    Instead of using : I sould use = to scecify cokie name and value.

     

    = Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

2 Replies

  • I understood waht the issue was.

    Instead of using : I sould use = to scecify cokie name and value.

     

    = Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))
    • Anonymous's avatar
      Anonymous
      Not applicable

      Good morning. How did you manage to get the cookie from power bi? I am currently making a request to obtain the cookie, said cookie comes in the headers of the server response.

      Thank you !