This is some edited code from a project, might be buggy, didn't test.
http = CreateObject("roUrlTransfer")
http.RetainBodyOnError(true)
messagePort = CreateObject("roMessagePort")
http.SetPort(messagePort)
http.setCertificatesFile("common:/certs/ca-bundle.crt")
http.InitClientCertificates()
http.addHeader("Some-Random-Header","header stuff")
http.SetUrl("http://something")
post = {
foo:"hello",
bar:"world"
}
postJSON = FormatJson(post)
response=""
lastresponsecode = ""
lastresponsefailurereason = ""
responseheaders = []
if http.AsyncPostFromString(postJSON) then
event = Wait(10000, http.GetPort())
if Type(event) = "roUrlEvent" Then
response = event.getString()
responseheaders = event.GetResponseHeaders()
lastresponsecode = event.GetResponseCode()
lastresponsefailurereason = event.GetFailureReason()
else if event = invalid then
http.asynccancel()
lastresponsefailurereason = "HTTP timed out. Configured Timeout: 10s"
lastresponsecode = 0
Else
? "AsyncPostFromString unknown event"
end if
end if
? "Response Headers: ";responseheaders
? "Response Code: ";lastresponsecode
? "Failure Reason: ";lastresponsefailurereason
? "Response: ";response