Skip to main content
authentication
Source Link
marya
  • 149
  • 2
  • 3
  • 13

I want to convert command line cURL to PHP cURL in order to have better control.

Note it is included authentication with MYUSER and MYTOKEN.

Linux server is running Apache 2 and PHP 7.2.

curl -u 'MYUSER:MYTOKEN' 'https://example.com' -X POST --data '{"domainNames":["example.org","site2.com"]}'

What PHP code would you use to obtain the same functionality?

I want to convert command line cURL to PHP cURL in order to have better control.

Linux server is running Apache 2 and PHP 7.2.

curl -u 'MYUSER:MYTOKEN' 'https://example.com' -X POST --data '{"domainNames":["example.org","site2.com"]}'

What PHP code would you use to obtain the same functionality?

I want to convert command line cURL to PHP cURL in order to have better control.

Note it is included authentication with MYUSER and MYTOKEN.

Linux server is running Apache 2 and PHP 7.2.

curl -u 'MYUSER:MYTOKEN' 'https://example.com' -X POST --data '{"domainNames":["example.org","site2.com"]}'

What PHP code would you use to obtain the same functionality?

2
mario
  • 145.8k
  • 20
  • 242
  • 293
Post Closed as "Duplicate" by jeroen, YvesLeBorg, mario php
Source Link
marya
  • 149
  • 2
  • 3
  • 13

Convert command line cURL to PHP cURL (with authentication)

I want to convert command line cURL to PHP cURL in order to have better control.

Linux server is running Apache 2 and PHP 7.2.

curl -u 'MYUSER:MYTOKEN' 'https://example.com' -X POST --data '{"domainNames":["example.org","site2.com"]}'

What PHP code would you use to obtain the same functionality?