me.fier.tcpserver/scripts/http_example/main.py

11 lines
404 B
Python

print("hello world")
http = mfp.require("http")
def _client(server,client):
client.cClient.connection.sendall("HTTP/1.1 200 OK\n".encode("ascii"))
client.cClient.connection.sendall(http.header.create([
["Content-Type","text/html; charset=ascii"],
["Content-Length","47"]
]).encode("ascii"))
client.cClient.connection.sendall("\n<html><body><h1>Hello, world</h1></body></html>".encode("ascii"))