title: How to create a cURL POST request in PHP
body: <p>I'm trying to figure out how to create a PHP cURL POST request. I have the following code to use. I'm a bit stuck on what the -g -X and -H means.</p>
  
  <pre><code>curl -g -X POST -H 'Authorization: bearer &lt;access_token&gt;' -d 'superTasks=["IEAE34A4KQATKP4S"]&amp;metadata=[{"key":"testMetaKey","value":"testMetaValue"}]&amp;priorityBefore=IEAE34A4KQATKP4S&amp;importance=High&amp;customFields=[{"id":"IEAE34A4JUAADKT3","value":"testValue"}]&amp;description=Test task description&amp;dates={"start":"2016-05-18","due":"2016-05-25"}&amp;title=Test task&amp;follow=true&amp;followers=["KUAHYFH4"]&amp;responsibles=["KUAHYFH4"]&amp;shareds=["KUAHYFH4"]&amp;parents=["IEAE34A4I4ATKP4L"]&amp;status=Active' 'https://www.wrike.com/api/v3/folders/IEAE34A4I4ATKP4L/tasks'
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>EDIT Added code below:</p>
  
  <pre><code>$postData = array(
      "title" =&gt; "Test task",
      "description" =&gt; "Test task description",
      "status" =&gt; "Active",
      "importance" =&gt; "Normal",
      "dates" =&gt; {"start":"2016-05-18","due":"2016-05-25"},
      "shareds" =&gt; ["KUAHYFH4"],
      "parents" =&gt; ["IEAE34A4I4ATKP4L"],
      "responsibles" =&gt; ["KUAHYFH4"],
      "followers" =&gt; ["KUAHYFH4"],
      "follow" =&gt; "true",
      "priorityBefore" =&gt; "IEAE34A4KQATKP4S",
      "priorityAfter" =&gt; "IEAE34A4KQATKP4S",
      "superTasks" =&gt; "["IEAE34A4KQATKP4S"]",
      "metadata" =&gt; "[{"key":"testMetaKey","value":"testMetaValue"}]"),
      "customFields" =&gt; [{"id":"IEAE34A4JUAADKT3","value":"testValue"}],
      "customStatus" =&gt; "string"
      );
  
  $handler = curl_init();
  
  curl_setopt($handler, CURLOPT_URL, "https://www.wrike.com/api/v3/folders/IEAE34A4I4ATKP4L/tasks");
  curl_setopt($handler, CURLOPT_POSTFIELDS, http_build_query($postData));
  curl_setopt($handler, CURLOPT_POST, true);
  curl_setopt($handler, CURLOPT_SSL_VERIFYPEER, false);
  
  curl_exec($handler);
  </code></pre>
  
  <p>By doing curl -h I got the following information:</p>
  
  <p>-g, --globoff       Disable URL sequences and ranges using {} and []</p>
  
  <p>-X, --request COMMAND  Specify request command to use</p>
  
  <p>-H, --header LINE   Pass custom header LINE to server (H)</p>
  
  <p>-d, --data DATA     HTTP POST data (H)</p>
  
  <p>But I can't figure out how to add these attributes.</p>