當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。