FAQ  •  Register  •  Login

Sending cookies with URL requests

<<

insane822

User avatar

Serviio lover

Posts: 61

Joined: Sat Aug 07, 2010 5:32 am

Post Mon May 14, 2012 3:11 am

Sending cookies with URL requests

Hello,

Are there any plugins that I can take a look at on how to send cookies with url requests?

I'm coming from python:
  Code:
self.cj = CookieJar()
#Setup URL handler
self.login = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj),urllib2.HTTPSHandler)

#Define my cookies
self.auth_cookie = "foobar"
self.session_cookie = "foobar3000"

#Append my cookies
self.login.addheaders.append(('Cookie', "auth=%s;session=%s" % (self.auth_cookie, self.session_cookie)))

#All subsequent requests will send the cookies
print self.login.open("http://www.example.com/video/12342/xml").read()
print self.login.open("http://www.example.com/video/323448745/xml").read()


Can anyone point me to a plugin that uses cookies? I've searched online, but none of the methods listed seem to be available.


Thanks!! :)
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Mon May 14, 2012 7:09 am

Re: Sending cookies with URL requests

Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon May 14, 2012 10:04 am

Re: Sending cookies with URL requests

if you just want it for GET requests look at the guide, Shared methods, openUrl()
<<

insane822

User avatar

Serviio lover

Posts: 61

Joined: Sat Aug 07, 2010 5:32 am

Post Mon May 14, 2012 12:25 pm

Re: Sending cookies with URL requests

Thanks to both of you. I looked at the guide last night, but I'll get myself some new glasses.. that helps a ton!

Thank you :D

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 16 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.