How to send array with CURL? Should I `urlencode` it?

前端 未结 5 1721
攒了一身酷
攒了一身酷 2021-01-03 23:12

When I assign an array of data to be POSTed as a cURL option (via CURLOPT_POSTFIELDS), do I need to urlencode that data first or will that be taken care of?

5条回答
  •  误落风尘
    2021-01-04 00:09

    One problem with using an array for CURLOPT_POSTFIELDS is that you can't have a name-value pair with an empty value.

提交回复
热议问题