Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Roku Guru

POST

This:
	http = NewHttp("https://api.twitter.com/1.1/statuses/update.json","" ,"POST")   
oa.sign(http,true)
http.PostFromStringWithTimeout( "status=test", 10 )


returns this:

Http: # 662 done status: 400 time: 246ms request: POST https://api.twitter.com/1.1/statuses/update.json
body: oauth_consumer_key=XX&oauth_nonce=XX&oauth_signature=9XX&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1383585583&oauth_token=XX&oauth_version=1.0

Why is the value string ""status=test" not attaching? The debugger wont let me do it any other way.
Thanks
Kinetics Screensavers
0 Kudos
2 REPLIES 2
RokuChris
Roku Employee
Roku Employee

Re: POST

Not super familiar with this example, but...

NewHTTP() and PostFromStringWithTimeout() are not SDK functions. They're defined in BrightScript somewhere in your channel. You need to find that code, look at what it does with the parameters you're passing, and modify it to do what you want.

The first place I would look is the call to Prep() and the value (if any) assigned to the callbackPrep attribute.

Function http_post_from_string_with_timeout(val As String, seconds as Integer) as String
m.Prep("POST")
if (m.Http.AsyncPostFromString(val)) then m.Wait(seconds)
return m.response
End Function
0 Kudos
squirreltown
Roku Guru

Re: POST

Thanks Chris, I will start my looking there.
Kinetics Screensavers
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.