Docs [Fix]: use bytes instead of strings while writing (#14505)
* Fix doc examples: use bytes instead of strings while writing * Add a note (comment) * nit * Update any_server.rst * Update docs/source-app/workflows/add_server/any_server.rst * Update docs/source-app/workflows/add_server/any_server.rst * Update docs/source-app/workflows/add_server/any_server.rst * Apply suggestions from code review Co-authored-by: Laverne Henderson <laverne.henderson@coupa.com> Co-authored-by: Ethan Harris <ethanwharris@gmail.com> Co-authored-by: thomas chaton <thomas@grid.ai>
This commit is contained in:
parent
dbd7703e88
commit
6de2b0b528
|
@ -31,7 +31,8 @@ Any server that listens on a port, can be enabled via a work. For example, here'
|
|||
def do_GET(self):
|
||||
self.send_response(HTTPStatus.OK)
|
||||
self.end_headers()
|
||||
html = "<h1 style='color: blue'> Hello lit world </div>"
|
||||
# Data must be passed as bytes to the `self.wfile.write` call
|
||||
html = b"<h1 style='color: blue'> Hello lit world </div>"
|
||||
self.wfile.write(html)
|
||||
|
||||
|
||||
|
@ -52,7 +53,8 @@ To enable the server inside the component, start the server in the run method an
|
|||
def do_GET(self):
|
||||
self.send_response(HTTPStatus.OK)
|
||||
self.end_headers()
|
||||
html = "<h1 style='color: blue'> Hello lit world </div>"
|
||||
# Data must be passed as bytes to the `self.wfile.write` call
|
||||
html = b"<h1 style='color: blue'> Hello lit world </div>"
|
||||
self.wfile.write(html)
|
||||
|
||||
|
||||
|
@ -81,7 +83,8 @@ In this case, we render the ``LitServer`` output in the ``home`` tab of the appl
|
|||
def do_GET(self):
|
||||
self.send_response(HTTPStatus.OK)
|
||||
self.end_headers()
|
||||
html = "<h1 style='color: blue'> Hello lit world </div>"
|
||||
# Data must be passed as bytes to the `self.wfile.write` call
|
||||
html = b"<h1 style='color: blue'> Hello lit world </div>"
|
||||
self.wfile.write(html)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue