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: 
gonzotek
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

"RokuJoel" wrote:
It turns out that the SetRequest method of roURLtransfer supports this:

http=createobject("roURLTransfer")
http.setRequest("PUT")

This is now published in the online SDK:
http://sdkdocs.roku.com/display/sdkdoc/ ... eqasString

- Joel

Great, thanks!

Just to be clear, you can do setRequest("DELETE"), as well as PUT, correct? And I know I'm shooting for the moon now, but could you also set it to one of the other even less-used verbs, like PATCH or TRACE? I don't need these (I can't think of anyone who does, for things you'd do with a Roku), and am fine if they can't be used, just want it clearly documented so people don't go pulling their hair out trying to do something that can't be done. 🙂
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
RokuJoel
Binge Watcher

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

My understanding is, any verb, but you might have to experiment with if you need to use asyncgettostring() vs asyncpostfromstring() to make them work properly.

- Joel.
0 Kudos
gonzotek
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

"RokuJoel" wrote:
My understanding is, any verb, but you might have to experiment with if you need to use asyncgettostring() vs asyncpostfromstring() to make them work properly.

- Joel.
Works for me, thanks again.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
wpinkman
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

I was just looking for a way to do a DELETE. I think this thread answers it, but I'm still a little unclear about which method to call to do the actual HTTP call once SetRequest("DELETE") has been called. You allays user the "xxxGetToxxx" family of methods?
--andy (channel: Rokagram)
0 Kudos
simranjit
Binge Watcher

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

Any update on this ?

I have to use HTTP DELETE for Restful web services on roUrlTransfer. Please suggest how I can implement this using roUrlTransfer.
0 Kudos
scottgarner
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

I also need this for a DELETE. I understand the .setRequest("DELETE") thing, but I need to pass a json string also. I don't have any problem doing a regular POST with .postFromString("{...}"). However, even if I setrequest/delete, when I call postfromstring, it looks like it's doing a POST and not a DELETE.

Anyone figure this one out?
0 Kudos
scottgarner
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

For the record...

    request.SetRequest("DELETE")
    response = request.GetToString()

Does work. 

I was originally trying to send a json object as the request body, then use .postFromString(), and that was not working (sending as a POST instead of as a DELETE). Since I was able to change my request so that I no longer needed to do that, this problem is averted for now....

It seems to me though, that this is functionality that was begun but never finished. Is this in the pipeline to be completed?
0 Kudos
NB_
Roku Guru

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

"scottgarner" wrote:
I was originally trying to send a json object as the request body, then use .postFromString(), and that was not working (sending as a POST instead of as a DELETE).

Can you clarify please - are you saying that .getToString() honors prior .setRequest() but .postFromString() overrides it?
0 Kudos
scottgarner
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

"RokuNB" wrote:
Can you clarify please - are you saying that .getToString() honors prior .setRequest() but .postFromString() overrides it?

Yes. That is precisely what I'm saying.
0 Kudos
Anish1
Visitor

Re: HTTP PUT for RESTful Web services on roUrlTransfer?

could you post your code ??? So that we can try to rectify...
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.