title: Passing the '+' character in a POST request in Python
body: <p>I am trying to do some automation in a Python script and I have run into a problem.  I am trying to do a POST to a server.</p>
  
  <pre><code>url = 'http://www.example.com'
  params = {'arg0': 'value', 'arg1': '+value'}
  
  f = urllib.urlopen(url, urllib.urlencode(params))
  print f.read()
  </code></pre>
  
  <p>I have done a wireshark capture of the equivalent browser operation, where the second arg, <code>arg1</code> is passed as <code>+value</code>, however when I do it with Python the <code>+</code> gets changed to <code>%2B</code>, i.e.</p>
  
  <pre><code>Line-based text data: application/x-www-form-urlencoded
  arg0=value&amp;arg1=%2Bvalue
  </code></pre>
  
  <p>when it should be:</p>
  
  <pre><code>Line-based text data: application/x-www-form-urlencoded
  arg0=value&amp;arg1=+value
  </code></pre>
  
  <p>I have also used the Requests module and it seems to do the same thing.</p>
  
  <pre><code>url = 'http://www.example.com'
  params = {'arg0': 'value', 'arg1': '+value'}
  
  f = requests.post(url, params)
  </code></pre>
  
  <p>Google is not your friend when you have a problem related to '+' as it seems to be a catch all for so much else.</p>