I want to send the body in a post request in brightscript, can't find any way to do this, My code
xfer = CreateObject("roURLTransfer")
xfer.SetRequest("POST")
xfer.PostFromString("queryString")
xfer.SetCertificatesFile("common:/certs/ca-bundle.crt")
xfer.AddHeader("Content-Type", "application/json")
xfer.AddHeader("Test-Header", "Test Header Value")
xfer.SetURL("https://d5c8-115-186-189-0.ap.ngrok.io/hello?title=hello&name=world")
queryString = xfer.Escape("?hello") + "&" + xfer.Escape("world")
print "Query String: " queryString
xfer.PostFromString(queryString)
xfer.InitClientCertificates()
rsp = xfer.GetToString()
json = ParseJson(rsp)
print "Rsp: " rsp
print "json: " json
print xfer.PostFromString(queryString)
I can send headers successfully, sending POST requests successfully, but the thing is, I can't send the body, can't figure out how to send the body, please help me, I am really stuck here, and not so many resources are available for Roku brightscript and their documentation is cold enough, I have read this whole page https://developer.roku.com/docs/references/brightscript/interfaces/ifurltransfer.md#ifUrlTransfer-PostFromString(requestasString)asInteger:3vqfjuna] please give me some helpful material to do this thing or give me any code snippet to do this, because, in the Roku Developer Forums, the solutions are not helpful, like this https://community.roku.com/t5/Roku-Developer-Program/How-to-pass-request-with-body-part-in-HTTP-POST-method-api-request/td-p/436560, from this link I have implemented different methods to send body, but not succeeded. Thanks in advance.