title: What means data-urlencode in CURL?
body: <p>I have searched many hours trying to figure out what --data-urlencode is in php curl.</p>
  
  <p>I tried this, but I dont think its right.</p>
  
  <pre><code>$xmlpost .= "object1[file]=@https://www.lob.com/goblue.pdf";
  </code></pre>
  
  <p>In the documentation it is:</p>
  
  <pre><code>--data-urlencode "object1[file]=https://xxx.pdf" \
  </code></pre>
  
  <p>But what is it in CURL? 
      <code>curl_setopt($cpt, CURLOPT_??)</code></p>
  
  <p>Full API DOCS says i need to call this</p>
  
  <pre><code>curl https://api.lob.com/v1/jobs \
  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
  -d "name=Demo Quick Print Job" \
  -d "to[name]=Harry Zhang" \
  -d "to[address_line1]=123 Test Street" \
  -d "to[address_city]=Mountain View" \
  -d "to[address_state]=CA" \
  -d "to[address_zip]=94085" \
  -d "to[address_country]=US" \
  -d "from[name]=Leore Avidar" \
  -d "from[address_line1]=123 Test Street." \
  -d "from[address_line2]=Apt 155" \
  -d "from[address_city]=Sunnyvale" \
  -d "from[address_state]=CA" \
  -d "from[address_zip]=94085" \
  -d "from[address_country]=US" \
  -d "object1[name]=testobject" \
  --data-urlencode "object1[file]=https://www.lob.com/goblue.pdf" \
  -d "object1[setting_id]=100"
  </code></pre>
  
  <p>I am therefore trying:</p>
  
  <pre><code>&lt;?php
   $xmlpost = array(
      "name" =&gt; "PostalAddressConfirmation",
      "to" =&gt; array(
          "name" =&gt; "Testing",
          "address_line1" =&gt; "testvej",
          "address_city" =&gt; "test",
          "address_state" =&gt; "test",
          "address_zip" =&gt; "5000",
          "address_country" =&gt; "DK"
      ),
      "from" =&gt; array(
          "name" =&gt; "test ApS",
          "address_line1" =&gt; "testvej 25",
          "address_city" =&gt; "test",
          "address_state" =&gt; "test",
          "address_zip" =&gt; "5000",
          "address_country" =&gt; "DK"
      ),
      "object1" =&gt; array(
          "name" =&gt; "test Object",
          "setting_id" =&gt; "100",
          "file" =&gt; "https://lob.com/goblue.pdf"
      )
  );
  
  $cpt = curl_init("https://api.lob.com/v1/job");
  curl_setopt_array($cpt, array(
      CURLOPT_RETURNTRANSFER =&gt; 1,
      CURLOPT_POSTFIELDS =&gt; $xmlpost,
      CURLOPT_USERPWD =&gt; 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:',
  ));
  
  $result = curl_exec($cpt);
  </code></pre>