Here is some code that loads the file:
file_size = os.path.getsize('Tea.rdf')
f = file('Tea.rdf')
c = pycurl.Curl()
c.setopt(pycurl.URL, 'http://localhost:8080/openrdf-sesame/repositories/rep/statements')
c.setopt(pycurl.HTTPHEADER, ["Content-Type: application/rdf+xml;charset=UTF-8"])
c.setopt(pycurl.PUT, 1)
c.setopt(pycurl.INFILE, f)
c.setopt(pycurl.INFILESIZE, file_size)
c.perform()
c.close()
Now I do not like this PycURL experience. Can you offer any alternative? Maybe urllib2 or httplib can do the same? Can you write code showing it?
Thank you very much!
source
share