title: Should I URL-encode POST data?
body: <p>I'm POSTing data to an external API (using PHP, if it's relevant).</p>
  <p>Should I URL-encode the POST variables that I pass?</p>
  <p>Or do I only need to URL-encode GET data?</p>
  <hr />
  <p>UPDATE: This is my PHP, in case it is relevant:</p>
  <pre><code>$fields = array(
      'mediaupload'=&gt;$file_field,
      'username'=&gt;urlencode($_POST[&quot;username&quot;]),
      'password'=&gt;urlencode($_POST[&quot;password&quot;]),
      'latitude'=&gt;urlencode($_POST[&quot;latitude&quot;]),
      'longitude'=&gt;urlencode($_POST[&quot;longitude&quot;]),
      'datetime'=&gt;urlencode($_POST[&quot;datetime&quot;]),
      'category'=&gt;urlencode($_POST[&quot;category&quot;]),
      'metacategory'=&gt;urlencode($_POST[&quot;metacategory&quot;]),
      'caption'=&gt;($_POST[&quot;description&quot;])
  );
  $fields_string = http_build_query($fields);
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_POST,count($fields));
  curl_setopt($ch,CURLOPT_POSTFIELDS,$fields);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $response = curl_exec($ch);
  </code></pre>