Forum Discussion
POST query with authorization token
Thanks Anonymous @but that is pretty much what we need to do: writing to a database.
I watch this video and that's what I'm trying to do. I have tried with a free API and works fine.
Thanks Anonymous - I think you need to change this step:
data = Text.FromBinary( Json.FromValue( [fieldName="someData"] ) )- Anonymous3 years agoNot applicable
I tried without Text.FromBinary, just Json.FromValue and the error remains
- Anonymous3 years agoNot applicable
Sorry - I sure how to help. Can you double check that Json is properly formatted by using VS Code or Postman. Obtain the Json from the Text.FromBinary step and past it into another tool to see if the error is occurring.
- Anonymous3 years agoNot applicable
This is the code using JsonPlaceHolder API:
let data = Json.FromValue([title = "ID_WERTPAPIER", body = "851399", userId = "US" ]), outputdata = Text.FromBinary(data), Source = Json.Document(Web.Contents("https://jsonplaceholder.typicode.com/posts", [Headers=[#"Content-Type"="application/json"], Content=data])) in SourceAnd it works!!! But if I use my own API, adding authorization to the header, something goes wrong, now the error message is this:
Expression.Error: We cannot convert a value of type Binary to type Text.
Details:
Value=[Binary]
Type=[Type]I know that my endpoint is working cause it works in postman.