当前位置: 首页>>代码示例>>Python>>正文


Python SimpleHTTPRequestHandler.end_headers方法代码示例

本文整理汇总了Python中http.server.SimpleHTTPRequestHandler.end_headers方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleHTTPRequestHandler.end_headers方法的具体用法?Python SimpleHTTPRequestHandler.end_headers怎么用?Python SimpleHTTPRequestHandler.end_headers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在http.server.SimpleHTTPRequestHandler的用法示例。


在下文中一共展示了SimpleHTTPRequestHandler.end_headers方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers(self):
     self.send_header('Access-Control-Allow-Origin', '*')
     self.send_header('Access-Control-Allow-Headers', 'x-request-timestamp, x-signature, electricitymap-token')
     self.send_header('Cache-Control', 'no-cache, no-store, must-revalidate')
     self.send_header('Pragma', 'no-cache')
     self.send_header('Expires', '0')
     SimpleHTTPRequestHandler.end_headers(self)
开发者ID:corradio,项目名称:electricitymap,代码行数:9,代码来源:server.py

示例2: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers(self):
     response_headers = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query).get('response_headers')
     if response_headers:
         headers = json.loads(response_headers[0])
         for header, value in headers:
             self.send_header(header, value)
     return SimpleHTTPRequestHandler.end_headers(self)
开发者ID:harvard-lil,项目名称:perma,代码行数:9,代码来源:utils.py

示例3: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers (self):
     self.send_header('Access-Control-Allow-Origin', '*')
     SimpleHTTPRequestHandler.end_headers(self)
开发者ID:radio-astro,项目名称:radiopadre,代码行数:5,代码来源:http_server.py

示例4: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers(self):
     self.gzip_headers()
     SimpleHTTPRequestHandler.end_headers(self)
开发者ID:ARM-DOE,项目名称:dv,代码行数:5,代码来源:dv.py

示例5: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers (self):
     self.send_header('Access-Control-Allow-Origin', '*')
     self.send_header('Access-Control-Allow-Methods', 'GET')
     self.send_header('Access-Control-Allow-Headers', '*')
     self.send_header('Access-Control-Allow-Headers', 'Pragma,Cache-Control,If-Modified-Since,Content-Type,X-Requested-With,X-stream,X-Ajax-Browser-Auth')
     SimpleHTTPRequestHandler.end_headers(self)
开发者ID:dhimmel,项目名称:neo4j-guides,代码行数:8,代码来源:http-server.py

示例6: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers(self):
     self.send_header("Access-Control-Allow-Origin","*")
     self.send_header("Access-Control-Allow-Headers", "Content-Type")
     SimpleHTTPRequestHandler.end_headers(self)     
开发者ID:ravithb,项目名称:open-labels,代码行数:6,代码来源:print_daemon.py

示例7: end_headers

# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import end_headers [as 别名]
 def end_headers(self):
     self.send_my_headers()
     SimpleHTTPRequestHandler.end_headers(self)
开发者ID:ericoporto,项目名称:fgmk,代码行数:5,代码来源:game_server.py


注:本文中的http.server.SimpleHTTPRequestHandler.end_headers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。