Forum Discussion
How to send a GET method with content data with M?
Have you tried manual status handling? E.g.:
= Value.Metadata(Web.Contents("https://example.com", [ManualStatusHandling={405}, Content=Text.ToBinary("<Content>")]))[Content.Uri]()
Artemus, thank you for your help. I can get the metadata after ManualStatusHandling, but I don't know where to go after that. Can't just use Web.Contents again using the Content.Uri, also can't use the Location header in the request because the response status isn't 300ish.
I think the solution would be using the WebAction.Request() function, but I always get an "We haven't been given permission to perform actions against this source" error on VS and "Object reference not set to an instance of an object" error on Power BI Desktop.
- artemus6 years agoMicrosoft Employee
When you do manual redirect handling, then the Contents.Uri will be transformed into a GET request (for most status codes).
- fdanielsouza6 years agoHelper I
Hmm, understood artemus! Should [Contents.Uri]() bring me the the content of the request if it was a GET or should I use it in another request? Right now it brings me the URL in text format.