S
S
Sergey Melnikov2015-07-25 13:59:03
Yii
Sergey Melnikov, 2015-07-25 13:59:03

How to make a post request with passing parameters as json?

Greetings. Plz tell me, how can I normally make a post request with json parameters?
Here is a dock for Yandex api https://tech.yandex.ru/direct/doc/dg-v4/examples/p...
Section "Getting information about the client", here some kind of pear is used. There is some more understandable option for calling a post request with passing json parameters, I want to use it in a yii2 project.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
matperez, 2015-07-25
@matperez

Try Guzzle . Great stuff.

P
Paulus, 2015-07-26
@ppokrovsky

Either an external library or parameters in Curl

curl -H "Content-Type: application/json" -X POST -d '{"locale":"ru","method":"GetCampaignsList", "param":"параметры метода"}' https://api.direct.yandex.ru/v4/json

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question