Question

I want to pass parameters with cURL and get it using argv

Just like -

curl 'http://xx.xx.xx.xx/test.php {MY JSON DATA}'

and I want this json data as an argument - like it should print an array of arguments like

Array
(
    [0] => test.php
    [1] => 2345232wqwfdwfsdf
)

Note - I can use POST/PUT method for getting the data but I want to know can I use argv when using curl command?

Was it helpful?

Solution

As for the posting of the data, see How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?

As for reading it inside of php, it will be in $_POST

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top