timeout% = 1500
roRequest = CreateObject("roURLTransfer")
roRequest.setUrl("http://httpbin.org/post")
roPort = CreateObject("roMessagePort")
roRequest.setPort(roPort)
roRequest.PostFromString("Please Work ")
sleep(1000)
if (roRequest.AsyncGetToString())
roEvent = wait(timeout%, roRequest.GetPort())
print roEvent
if type(roEvent) = "roUrlEvent"
str = roEvent.GetString()
print "i am here"
print roEvent.GetResponseCode()
print str
else if roEvent = invalid
roRequest.AsyncCancel()
REM reset the connection on timeouts
print "Unknown"
else
print "roUrlTransfer::AsyncGetToString(): unknown event"
endif
endif
timeout% = 1500
roRequest = CreateObject("roURLTransfer")
roRequest.setUrl("http://httpbin.org/post")
print "start from here"
roPort = CreateObject("roMessagePort")
roRequest.setPort(roPort)
print "after setting the port"
sleep(1000)
if (roRequest.AsyncPostFromString("Please Work"))
roEvent = wait(timeout%, roRequest.GetPort())
print roEvent
if type(roEvent) = "roUrlEvent"
str = roEvent.GetString()
print "i am here"
print roEvent.GetResponseCode()
print str
else if roEvent = invalid
roRequest.AsyncCancel()
REM reset the connection on timeouts
print "Unknown"
else
print "roUrlTransfer::AsyncGetToString(): unknown event"
endif
endif