Created
December 4, 2013 00:57
-
-
Save hackerain/7780531 to your computer and use it in GitHub Desktop.
wsme.types.File example
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 wsme | |
| from pecan import rest | |
| from wsmeext.pecan import wsexpose | |
| class RootController(rest.RestController): | |
| @wsexpose(wsme.types.File) | |
| def get(self): | |
| f = open('/tmp/test/works/works/templates/index.html', 'r') | |
| return wsme.types.File(filename='index.html', | |
| file=f, | |
| contenttype='text/html') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment