Skip to content

Instantly share code, notes, and snippets.

@cdent
Created March 23, 2010 14:35
Show Gist options
  • Save cdent/341236 to your computer and use it in GitHub Desktop.
Save cdent/341236 to your computer and use it in GitHub Desktop.
"""
PUT a tiddler.
"""
import httplib2
def put(server, bag, tiddler, body):
http = httplib2.Http()
url = '%s/bags/%s/tiddlers/%s' % (server, bag, tiddler)
response, content = http.request(url,
method='PUT',
headers={'Content-Type': 'application/json'},
body=body)
return response['status']
if __name__ == '__main__':
status = put('http://tiddlyweb.peermore.com/wiki', 'common', 'something',
'{"modifier":"cdent","text":"oh hai!"}')
print status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment