How to parse raw HTTP request in Python 3?
<p>I am looking for a native way to parse an http request in Python 3.</p>

<p><a href="https://stackoverflow.com/questions/4685217/parse-raw-http-headers">This question</a> shows a way to do it in Python 2, but uses now deprecated modules, (and Python 2) and I am looking for a way to do it in Python 3.</p>

<p>I would mainly like to just figure out what resource is requested and parse the headers and from a simple request. (i.e):</p>

<pre><code>GET /index.html HTTP/1.1
Host: localhost
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
</code></pre>

<p>Can someone show me a basic way to parse this request?</p>