Hi All, This is regarding "creating a pdf file in SharePoint Library using "send http request of SharePoint". Below is the action I am using.

Content-Length: length(variables('varContent'))
Uri: _api/web/GetFolderByServerRelativeUrl('students')/Files/add(url='a.txt',overwrite=true)
Content: body('pmw')?['$content']
PMW - Populate a Microsoft Word template
For testing purpose - I was trying to create .txt file:
Error Message:
Spoiler (Highlight to read)
{
"error": {
"code": 500,
"source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net",
"clientRequestId": "4776e0da-1c7d-40a0-98d8-c30044bc33cd",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "Bytes to be written to the stream exceed the Content-Length bytes size specified.\r\nclientRequestId: 4776e0da-1c7d-40a0-98d8-c30044bc33cd",
"errors": []
}
}
}
{ "error": { "code": 500, "source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net", "clientRequestId": "4776e0da-1c7d-40a0-98d8-c30044bc33cd", "message": "BadGateway", "innerError": { "status": 500, "message": "Bytes to be written to the stream exceed the Content-Length bytes size specified.\r\nclientRequestId: 4776e0da-1c7d-40a0-98d8-c30044bc33cd", "source": "https://sharepointonline-eus2.azconn-eus2.p.azurewebsites.net/datasets/https%253A%252F%252FABCD.sharepoint.com%252Fsites%252FTEAMAPPS/httprequest", "errors": [] } }}
Size of the word document:
25KB