2 Comments
- AnonymousNot applicable
Hi PeterPhrak ,
I'm not sure this fits your needs. It is possible to omit the web.content header.
However, it’s important to note that the Authorization header is often required for authenticated API requests. If you omit it, you may not be able to access the data you need.
Use the UsernamePassword or Key credential type instead of Anonymous. This allows you to provide the necessary credentials without using the Authorization header.
If you’re using UsernamePassword, the Username and Password fields can be used to store the information needed to build your URI string.
In your Web.Contents call, avoid defining headers inline. Instead, consider building your headers separately and then passing them into the Web.Contents function.
Here’s an example of how you might structure your code:let apiUrl = "https://mysite.azurewebsites.net" & "/api/v1.0/Report/Setter", options = [Headers=[#\"Content-Type\"=\"application/json\"]], // Define your headers here result = Json.Document(Web.Contents(apiUrl, options)) in resultBest regards,
Community Support Team_ Scott Chang - PeterPhrakFrequent Visitor
Thanks for your response Anonymous , this won't work in this scenario as we can only utilise the OAuth type at this time. In addition to this, the initial API request to request the data requires the token from the OAuth type.
I understand that the Authorization header is key is required for authenticated requests but having duplicate headers is causing some issues here.