title: python3 Error： can't concat str to bytes
body: <p>I want to use python to login a website and I make a post request to <code>/login</code> and I want to see the http post result, but it show me an error:  can't concat str to bytes, what does this error means? And how can I solve it? My python version is 3.6.5.</p>
  
  <pre><code>#! python3
  # https://shimo.im/login
  import urllib.request
  import ssl
  
  loginUrl = 'https://shimo.im/login'
  context = ssl._create_unverified_context()
  headers = {'content-type': "application/x-www-form-urlencode"}
  payload = {
      'email': 'aaa@qq.com',
      'password': 'dddddd+',
      'remember': 'check'
  }
  
  req = urllib.request.Request(loginUrl, payload, headers=headers)
  data = urllib.request.urlopen(req, context=context).read()
  
  print(data)
  </code></pre>
  
  <p>The more detail of error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "E:/test/python-test/learn.py", line 17, in &lt;module&gt;
      data = urllib.request.urlopen(req, context=context).read()
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 223, in urlopen
      return opener.open(url, data, timeout)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 526, in open
      response = self._open(req, data)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 544, in _open
      '_open', req)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 504, in _call_chain
      result = func(*args)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 1361, in https_open
      context=self._context, check_hostname=self._check_hostname)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 1318, in do_open
      encode_chunked=req.has_header('Transfer-encoding'))
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 1239, in request
      self._send_request(method, url, body, headers, encode_chunked)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 1285, in _send_request
      self.endheaders(body, encode_chunked=encode_chunked)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 1234, in endheaders
      self._send_output(message_body, encode_chunked=encode_chunked)
    File "C:\Users\dev2\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 1064, in _send_output
      + b'\r\n'
  TypeError: can't concat str to bytes
  </code></pre>