Writing response body with BaseHTTPRequestHandler

前端 未结 4 1453
挽巷
挽巷 2021-02-03 21:06

I\'m playing a little with Python 3.2.2 and want to write a simple web server to access some data remotely. This data will be generated by Python so I don\'t want to use the Sim

4条回答
  •  孤街浪徒
    2021-02-03 21:47

    based on your code #comments you're probably looking for self.headers.getheaders('referer'), ie:

    if 'http://www.icamefromthissite.com/' in self.headers.getheaders('referer'):
        do something
    

提交回复
热议问题