上传文件错误返回HTTP状态400

def HTTP_main(self):
    if an error :
        self.write('''\ HTTP/1.1 400 Internal error\r\nContent-Type:text/html;charset=utf-8\r\n\r\n\ ''')
        self.write('error msg')
        return self.close()
    # do upload