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?
You don't have to urlencode first. However, it is important to realize that passing an array will make cURL send it as multipart/form-data
, which explains why it is does not need to get urlencoded (by neither you nor cURL), and you need to use an array if you want to upload files. If you http_build_query()
first (and send it as a string) it will be treated as application/x-www-form-urlencoded
.