Forum Discussion
RokuKevin
15 years agoVisitor
There is no way to increase the length of a captured packet in the Roku's tcpdump utility.
You would generally send the cookie via the second request via a cookie as theEndless points out.
Here's an example:
--Kevin
You would generally send the cookie via the second request via a cookie as theEndless points out.
Here's an example:
request = createObject("roUrlTransfer")
port = CreateObject("roMessagePort")
request.setPort(port)
timeout% = 1000 * 5
resArray = CreateObject("roArray", 5, false)
request.setUrl(loginUrl)
if (request.AsyncGetToString())
event = wait(timeout%, request.GetPort())
if type(event) = "roUrlEvent"
resArray.push(event.GetString())
resArray.push(event.GetResponseHeadersArray())
elseif event = invalid
print "AsyncPostFromString timeout"
request.AsyncCancel()
else
print "AsyncPostFromString unknown event"; event
endif
endif
cookiesArray = CreateObject("roArray", 2, True)
for each elem in resArray[1]
for each obj in elem
if obj = "Set-Cookie" Then
cookiesArray.push(elem[obj])
end if
end for
end for
request2 = createObject("roUrlTransfer")
request2.setPort(port)
request2.seturl(userDataUrl)
for each cookie in cookiesArray
request2.AddHeader("Cookie", cookie)
end for
userData = request2.GetToString()
--Kevin