Forum Discussion
EPetit
5 years agoRegular Visitor
DataFormat.Error: We found extra characters at the end of JSON input
Hello,
I got this problem when I connect PBI with API Rest using Web.contents()
I don't understand what happened. Someone can explain to me ?
Here my code :
let
Source = Json.Document(Web.Contents("xxx",
[
RelativePath = "xxx",
Content=Text.ToBinary(""),
Headers=[#"Content-Type"="application/json",
Authorization="Bearer xxx"
]
]))
in
Source
Thanks !
Hi EPetit
It should be #"Authorization" in Headers
let Source = Json.Document(Web.Contents("xxx", [ RelativePath = "xxx", Content=Text.ToBinary(""), Headers=[#"Content-Type"="application/json", #"Authorization"="Bearer xxx" ] ])) in SourcePhil
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.
2 Replies
- PhilipTreacy
Super User
Hi EPetit
It should be #"Authorization" in Headers
let Source = Json.Document(Web.Contents("xxx", [ RelativePath = "xxx", Content=Text.ToBinary(""), Headers=[#"Content-Type"="application/json", #"Authorization"="Bearer xxx" ] ])) in SourcePhil
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. - lbendlin
Super User
Are you intentionally making this a POST request?
Does the same request work from an API test site? Like https://reqbin.com/