Answers for "php curl content type"

PHP
1

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.
Posted by: Guest on October-18-2021
0

curl content-type

curl 'https://httpbin.org/post' -H 'Content-Type: application/x-www-form-urlencoded' -d 'param1=value1&param2=value2'
Posted by: Guest on August-27-2021

Browse Popular Code Answers by Language