(connection: socket.socket, data: str, contentType: str)
| 1149 | |
| 1150 | |
| 1151 | def httpGetResponse(connection: socket.socket, data: str, contentType: str) -> None: |
| 1152 | resp = 'HTTP/1.1 200 OK\r\n' |
| 1153 | resp += 'Connection: close\r\n' |
| 1154 | resp += 'Content-length: ' + str(len(data)) + '\r\n' |
| 1155 | resp += 'Content-type: ' + contentType + '\r\n\r\n' |
| 1156 | resp += data |
| 1157 | sendAll(connection, resp) |
| 1158 | |
| 1159 | |
| 1160 | class HttpClientThread(Thread): |