title: Python - Building a HTTP request string variable
body: <p>I am trying to build the HTTP request string in the variable "full_req".  Here is how a HTTP request looks:</p>
  
  <pre><code>GET /images/logo/ HTTP/1.1
  Host: www.google.com
  Connection: close
  </code></pre>
  
  <p>I already wrote python code so if I enter a url, "<a href="http://www.google.com/images/logo/googlelogo.png" rel="nofollow">http://www.google.com/images/logo/googlelogo.png</a>", it will split the url into 3 parts.  Below are the variables that I used:</p>
  
  <ul>
  <li><code>host</code> (contains <code>www.google.com</code>)</li>
  <li><code>path</code> (contains <code>/images/logo/</code>)</li>
  <li><code>file</code> (contains <code>googlelogo.png</code>)</li>
  <li><code>port</code> (Its showing <code>None</code> but I think its suppose to say <code>80</code>)</li>
  </ul>
  
  <p>How do I assign HTTP request string to <strong>full_req</strong> variable so if I print this variable, it contains all three lines?</p>
  
  <pre><code>print(full_req)
  </code></pre>
  
  <p>tried string concatenation but it didn't work.  I used this resource: <a href="http://www.skymind.com/~ocrow/python_string/" rel="nofollow">http://www.skymind.com/~ocrow/python_string/</a></p>