Add fuzzy and text-classification light model #1
					 1 changed files with 5 additions and 5 deletions
				
			
		Add utf-8 charset to api
				commit
				
					
					
						051f42cf17
					
				
			
		|  | @ -2,6 +2,7 @@ import http.server | |||
| import json | ||||
| import logging | ||||
| 
 | ||||
| 
 | ||||
| def get_server(ip, port, answer_function): | ||||
|     class Server(http.server.BaseHTTPRequestHandler): | ||||
| 
 | ||||
|  | @ -16,10 +17,9 @@ def get_server(ip, port, answer_function): | |||
|             logging.info('Get request:' + text) | ||||
|             print(text) | ||||
|             self.send_response(200) | ||||
|             self.send_header('Content-type','text/plain') | ||||
|             self.send_header('Content-type', 'text/plain; charset=utf-8') | ||||
|             self.end_headers() | ||||
| 
 | ||||
|              | ||||
|             self.wfile.write(res.encode()) | ||||
| 
 | ||||
|     return http.server.HTTPServer((ip, port), Server) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue