Skip to content

Instantly share code, notes, and snippets.

@fuzzy-focus
Created January 17, 2017 08:20
Show Gist options
  • Save fuzzy-focus/e3a15582879427d8f3ba5df9215fef1e to your computer and use it in GitHub Desktop.
Save fuzzy-focus/e3a15582879427d8f3ba5df9215fef1e to your computer and use it in GitHub Desktop.
Hug Put Demo
import requests
print(requests.put('http://localhost:8000/test',data={'txt':'Hello World'}).json())
# prints "success"
# run with 'hug -f hug-server.py'
import hug
@hug.put()
def test(txt: hug.types.text):
print(txt)
return 'success'
# prints "Hello World"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment