title: Where do I need to URL-encode POST data?
body: <p>Where should I URL-encode my POST request data? For each param, or for the whole query line? </p>
  
  <p>For example, I have this code:</p>
  
  <pre><code>@VIEWSTATE = url_encode(@VIEWSTATE)
  data = ("__EVENTTARGET=&amp;__EVENTARGUMENT=&amp;__LASTFOCUS=&amp;__VIEWSTATE=#{@VIEWSTATE}&amp;__EVENTVALIDATION=#{@EVENTVALIDATION}&amp;=ctl0.......
  headers = {
    'Cookie' =&gt; cookie,
  ***
  }
  
  resp, data = http.post(path, data, headers)
  </code></pre>
  
  <p>Is it right, or must I write:</p>
  
  <pre><code>@VIEWSTATE = @VIEWSTATE
      data = url_encode("__EVENTTARGET=&amp;__EVENTARGUMENT=&amp;__LASTFOCUS=&amp;__VIEWSTATE=#{@VIEWSTATE}&amp;__EVENTVALIDATION=#{@EVENTVALIDATION}&amp;=ctl0.......
      headers = {
        'Cookie' =&gt; cookie,
      ***
      }
  
      resp, data = http.post(path, data, headers)
  </code></pre>
  
  <p>Which is right, and which is better?</p>