Forum Discussion
Post JSON without PowerBI Reformatting it
- 4 years ago
You are supposed to use Text.ToBinary, not Text.FromBinary.
You are supposed to use Text.ToBinary, not Text.FromBinary.
Many thanks for this, I think I tried so many things over many days I kept this error in, I installed fiddler and got a bit further, the posted JSON appears to be valid.
What's happening is becuase I have:
Prisma = [
Authentication = [
UsernamePassword = [
UsernameLabel = "API User",
PasswordLabel = "API Password"
]
],
Label = "Data Connector"
];Power Query is adding a header:
Authorization: Basic XXXX
The remote webserver is replying:
message=request has different values in X-Redlock-Auth and Authorization, unclear which to use.
It doesn't understand why I'm sending over an API key and setting the Authorization header to basic.
Is there a way to remove Authorisation from the header or change my inputs so I can ask the end user for a username / password (this is how I get the login key) but don't set the header?
- Anonymous4 years agoNot applicable
Just an update, I got it to work (thanks for the advice), sharing for completeness
I needed:
ManualCredentials = true
In the request.
responseAlert = Web.Contents("https://api.io/v2/alert", [ Headers = [ #"Content-Type" = "application/json", #"x-redlock-auth" = token ], Content = Text.ToBinary(alertPayload), ManualCredentials = true ]),