0

I need to send this curl using PHP but i cannot find anywhere how to use --form. Here is the curl code I want to execute.

curl --location --request POST 'https://link.xyz/auto/api' \
--header 'X-Api-Key: YOUR-API-KEY-HERE' \
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4086.0 Safari/537.36' \
--form 'email=EMAIL-HERE' \
--form 'password=PASSWORD-HERE' \
--form 'key=KEY-HERE'
loverr9
  • 3
  • 2
  • 3
    Does this answer your question? [PHP + curl, HTTP POST sample code?](https://stackoverflow.com/questions/2138527/php-curl-http-post-sample-code) – Ersoy May 28 '20 at 19:18
  • note that the top answer in the duplicate will send it in `application/x-www-form-urlencoded` but the 2nd answer will send it in the same format as your sample curl code, called `multipart/form-data`-format – hanshenrik May 28 '20 at 19:30

0 Answers0