By default if you include the data field within the HTTP.Request it will do a POST. There is also a method field that you can populate to use PUT and other methods. Most of what you have above seems to be headers, they can be passed as a dictionary.
HTTP.Request(url, data=d, headers=h, method=m)
Not 100% on the name of the method field (without double checking) but know it takes a string value.
method field takes a string value.
Edit: double checked the method name, and is correct.
Did some digging and found the following:
HTTP.Request(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, immediate=False, sleep=0, data=None, follow_redirects=True, method=None)
Plist.ObjectFromURL(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, sleep=0, follow_redirects=True, method=None, max_size=None)
JSON.ObjectFromURL(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, sleep=0, follow_redirects=True, method=None, max_size=None)
RSS.FeedFromURL(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, sleep=0, follow_redirects=True, method=None, max_size=None)
YAML.ObjectFromURL(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, sleep=0, follow_redirects=True, method=None, max_size=None)
XML.ElementFromURL(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, sleep=0, follow_redirects=True, method=None, max_size=None)
HTML.ElementFromURL(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=GLOBAL_DEFAULT_TIMEOUT, sleep=0, follow_redirects=True, method=None, max_size=None)
Each of the above can issue a POST when method = "POST" and use the values field to pass URL encoded content for the POST request. The values field takes a dict. The above functions were taken from the parsekit.py and networkkit.py files, and show their default input. Files located here:
Plug-ins-cece46d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/parsekit.py
Plug-ins-cece46d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/networkkit.py
Notes:
-
HTTP.Request() function is the only one with a data field. Also you cannot use the data and values field within the same request.
- I Have not tested any of the above except for the
HTTP.Request() as previously described.
- For full explanation of each function above, refer to their functions within their respective files. Each are documented with value types and intended functionality.
-
Plug-ins-cece46d is specific to PMS v0.9.16.3. <hash> depends on current Plex Media Server (PMS) version, (where <hash> is Plug-ins-<hash>).