Re: "When a HTTP request is received" trigger breaks with SharePoint
I found the problem - it was an issue with jQuery in the calling code. For anyone interested:
The $.ajax() function has a dataType property that I set to "json" thinking that it would automatically set the header's content-type, but it actually only sets the data type expected in the return. The default content-type is "application/x-www-form-urlencoded".
$.ajax({
type: "POST",
url: $(this).attr("action"),
dataType: "json",
data: json_obj,
})
This worked at first, but made the properties very difficult to access in Power Automate, which should have been my first clue. Then, of course, adding a SharePoint or SQL Server connector caused the whole flow to fail with BadRequest.
To solve the problem I added a contentType property set to "application/json" and converted the payload from a json object to a string:
$.ajax({
type: "POST",
url: $(this).attr("action"),
dataType: "json",
contentType: "application/json; charset=utf-8", // Set the content-type
data: JSON.stringify(json_obj), // Stringify the output
})