Forum Discussion
Web.Contents with the Content option is only supported when connecting anonymously
- Anonymous3 years ago
Hi Anonymous ,
The error message you received indicates that the web service you are trying to connect to does not support sending data with authentication. One way to work around this issue is to encode the authentication information in the URL itself.
To do this, you can modify your code as follows:
let url = "https://username:[email protected]/data", body = "{}", header = [#"Content-Type"="application/json"], result = Json.Document(Web.Contents(url,[Headers = header, Content=Text.ToBinary(body)])) in resultReplace "username" and "password" with your actual credentials, and "api.example.com/data" with the URL of the web service you are trying to connect to. This should allow you to make a POST request with a body and basic authentication.
How to Get Your Question Answered Quickly
If it does not help, please provide more details.
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please correct the typo in your code sample: it must read "Authorization" instead of "Authoritation".