Created
January 17, 2017 08:20
-
-
Save fuzzy-focus/e3a15582879427d8f3ba5df9215fef1e to your computer and use it in GitHub Desktop.
Hug Put Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
print(requests.put('http://localhost:8000/test',data={'txt':'Hello World'}).json()) | |
# prints "success" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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