Re: Using CURL to force library refresh
Xmantium test this for me,
I have added a header to the POST request telling the REST interface it is xml.
the highlighted text is the added info to the script.
headers = { "Content-type": "text/xml" }
connection.request('POST', '/rest/action' , body_content , headers)
or copy + paste the whole script.
- Code:
#!/usr/bin/env python
import httplib
connection = httplib.HTTPConnection('192.168.1.6:23423')
body_content = '<action><name>forceLibraryRefresh</name></action>'
headers = { "Content-type": "text/xml" }
connection.request('POST', '/rest/action' , body_content , headers)
result = connection.getresponse()
if result.status == 200:
print "Updated Serviio Library",
else :
print "Update Failed",
print result.status,
hope it helps
J03