(self, url)
| 42 | self.header = ["Location", target] |
| 43 | |
| 44 | def request (self, url): #Sends a HTTP request (useful for HTTP APIS). If you don't need the response, you can do this after calling send. This will decrease loading time in the browser |
| 45 | f = urllib.request.urlopen(url) |
| 46 | return(f.read().decode('utf-8')) |
| 47 | |
| 48 | def send (self): #Send the answer to the browser |
| 49 | self.connection.send_response(self.response) |