pradeeptv
13 years agoVisitor
HTTP Post Not working
We are trying to implement the HTTP POST request on the ROKU but it is not working giving us the HTTP 405 error, but we are posting the data with the method PostFromString("").
Please Find the Code Snippet
Thanks In Advance.
Bhushan
Please Find the Code Snippet
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
Thanks In Advance.
Bhushan