Forum Discussion
Zack92
Helper III
2 years agoPower BI POST Request is not working
Hey there!
Could someone assist me in setting up a Power BI POST Request? I've tackled plenty of REST requests before (I am not cord-savvy), but POST is throwing me for a loop. I've tried some code I found, but it's not cooperating. Any help would be awesome, thanks!
let
URL = "https://api2.clarizen.com/v2.0/services/authentication/login",
Body = Json.FromValue([
userName = "[email protected]",
Password = "APItest@ssword"
]),
Headers = [
#"Content-Type" = "application/json"
],
Response = Web.Contents(
URL,
[
Content = Body,
Headers = Headers,
Method = "POST"
]
),
ResponseText = Text.FromBinary(Response)
in
ResponseTextError
Expression.Error: 'Method' isn't a valid Web.Contents option. Valid options are:
ApiKeyName, Content, ExcludedFromCacheKey, Headers, IsRetry, ManualStatusHandling, Query, RelativePath, TimeoutAny other easy way we can do this? Response will be session Key
Thank you
1 Reply
- lbendlin
Super User
Please follow the documentation. POST is automatically implied when you provide a payload. Do not specify the method. https://learn.microsoft.com/en-us/powerquery-m/web-contents