Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
btpoole
Level 7

Malformat Curl

Attempting to use GetToFile to call a url with additional information in the url that is required. I can use a curl command with the sample below and all works. I created a roUrlTransfer and set the url to the same url being used in the curl but I am not getting anything. I have set up something to chekc the error, seems to be coming back as -3, malformat. Does the seturl need to be formatted another way? I have a feeling it has to do with the -H, but not sure how to include it in the url other than I have it. Works as shown for the curl.
Thanks

sample used in curl:
curl -o test  "http://www.my.tv/view/9/mytvchannel" -H"Cookie: __utma=266575877.1194741149.1414192833.1414195674.1414256069.3; __utmz=266575877.1414192833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); usernameSeeon=xxxxxx; passwordSeeon=43bbd81debaf028cb1b5f2086b7720111d06f97addb82ab7d07d352883ea2dd7d; cometchatuserid=2536; PHPSESSID=p0sqeaqam1u4b46gnqsf06j722; ccode=US; seeon9=1"


example of seturl:
tokenurl=chr(34) +  "http://www.my.tv/view/9/mytvchannel" + chr(34) + " -H" + chr(34) + "Cookie: __utma=266575877.1194741149.1414192833.1414195674.1414256069.3; __utmz=266575877.1414192833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); usernameSeeon=xxxxxx; passwordSeeon=43bbd81debaf028cb1b5f2086b7720111d06f97addb82ab7d07d352883ea2dd7d; cometchatuserid=2536; PHPSESSID=p0sqeaqam1u4b46gnqsf06j722; ccode=US; seeon9=1" + chr(34)
xfer.seturl(tokenurl)
0 Kudos
2 Replies
RokuMarkn
Level 7

Re: Malformat Curl

Using -H is specific to curl, it won't work with anything else and it definitely doesn't belong in a URL. In Brightscript the corresponding mechanism is ifHttpAgent.AddHeader. Since it's a cookie you're trying to add, you might also be able to use the Cookie methods in ifHttpAgent, but I'd start with AddHeader and make sure that works first.

--Mark
0 Kudos
btpoole
Level 7

Re: Malformat Curl

Thanks for the help, the AddHeader worked perfectly.
0 Kudos