Ciao karl94 non voglio sembrare arrogante anzi ti dirò che ti apprezzo leggerti e dare una mano a chi a bisogno. Fatta questa premessa andiamo al dunque, sul manuale per curl_setopt sta scritto che quando si abilità CURLOPT_POST TRUE è la normale operazione di un form
Codice:
TRUE to do a regular HTTP POST. This POST is the normal application/x-www-form-urlencoded kind, most commonly used by HTML forms.
e se si usa CURLOPT_POSTFIELDS
Codice:
The full data to post in a HTTP "POST" operation. To post a file, prepend a filename with @ and use the full path. The filetype can be explicitly specified by following the filename with the type in the format ';type=mimetype'. This parameter can either be passed as a urlencoded string like 'para1=val1¶2=val2&...' or as an array with the field name as key and field data as value. If value is an array, the Content-Type header will be set to multipart/form-data. As of PHP 5.2.0, value must be an array if files are passed to this option with the @ prefix. As of PHP 5.5.0, the @ prefix is deprecated and files can be sent using CURLFile. The @ prefix can be disabled for safe passing of values beginning with @ by setting the CURLOPT_SAFE_UPLOAD option to TRUE.
come stringa è lo stesso content type mentre se si utilizza come array è multipart/form-data (se ho capito bene il content type si puo impostare solo se è un file e viene inviato come string). Qui si invia dati non si affettuava una richiesta (GET) comunque in richiesta si dice io accetto ed in risposta il content type che accetta il browser!! Perciò se non viene modificato sul manuale è errato (anche il solo pensarlo) application/xml .Ti sarei grado di sapere se il mio pensiero sia errato?