Framework Obj Container and http header

Struggling with adding an http header to an object container

 

 

 

Tried the following:

oc = ObjectContainer(replace_parent=True, http_headers={'content':'Tommy=1'})

and this as well

oc.add(DirectoryObject(key=Callback(backgroundScan, title=title, sectiontype=sectiontype, key=key), title='Look in section "' + title + '"', summary='Look for unmatched files in "' + title + '"', http_headers={'content':'Tommy=2'}))

Above get's accepted by the framework, but sadly fails to see the headers are added on the webpage :(

 

 

And yes......Undocumented, but avail, so I thought I would run it by all of you

 

/Tommy

Nobody?

The http_headers parameter used to be available with older framework versions, where it was used in combination with MediaContainer. You could add videos directly to a MediaContainer and then set extra headers for the video player.

With the later version(s) of the framework, where we use URL Services to add media information, when we need extra http headers we set them inside the URL Service. If you need to set headers for other htp requests, you can set them in the HTTP.Request / HTML.ElementFromURL / etc. functions.

# Create a dict with the headers you'd like to send
my_headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:25.0) Gecko/20100101 Firefox/25.0',
    'content': 'Tommy=1'
}

The HTTP request with extra headers added

data = HTTP.Request(‘http://www.example.com/’, headers=my_headers).content

Darn.....I was hoping to create a menu, that coupd auto refresh every 15 sec, when a background thread was running, in order to avoid framework timeout

/T

Darn.....I was hoping to create a menu, that coupd auto refresh every 15 sec, when a background thread was running, in order to avoid framework timeout

/T

Autorefreshing a list (ObjectContainer) is also no longer possible. The framework supports (mostly) things that are available on alle the Plex clients.

Autorefreshing a list (ObjectContainer) is also no longer possible. The framework supports (mostly) things that are available on alle the Plex clients.

Man......You sure know howto ruin a mans christmas :lol:

Okay, so new Q......

Any way  to override the GLOBAL_DEFAULT_TIMEOUT when creating an ObjectContainer?

And huge Thanks for responding here

/Tommy

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.