Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marcoleong
Created January 29, 2019 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoleong/c6754672f39424afa14af9179175e575 to your computer and use it in GitHub Desktop.
Save marcoleong/c6754672f39424afa14af9179175e575 to your computer and use it in GitHub Desktop.
Kubeless Python Botte response binary file
from bottle import abort, HTTPResponse
def handle(data, event):
headers = dict()
content = # binary content
headers['Content-Type'] = 'image/jpeg'
headers['Content-Disposition'] = 'inline'
headers['Content-Length'] = len(content)
headers['Etag'] = response.headers['Etag']
headers['Date'] = response.headers['Date']
headers['Last-Modified'] = response.headers['Last-Modified']
body = content
return HTTPResponse(body, **headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment