Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php curl Content-Length

You shouldn't have to set the content-length yourself.
If you use cURL to send an HTTP POST, 
it will calculate the content length for you.

If you set the CURLOPT_POSTFIELDS value as an array,
it will automatically submit the request as multipart/form-data and use a boundary. 
If you pass a string, it will use application/x-www-form-urlencoded 
so make sure you pass a urlencoded string to CURLOPT_POSTFIELDS and
not an array since you want form-urlencoded.
 
PREVIOUS NEXT
Tagged: #php #curl
ADD COMMENT
Topic
Name
1+8 =