H
H
hyget2018-03-26 19:41:55
PHP
hyget, 2018-03-26 19:41:55

How to make a POST request in Guzzle?

Hello, please help me to make a request in guzzle;
I tracked this post request:
5ab920c14ee97255975808.png
the result, as I understand it, is the json output
and I need to get it.
I tried different ways, but it does not work, apparently I'm doing something wrong.

$response = $client->post($url,[
    'json' => [
      'action' => 'mainPosts',
      'offset'=> '0',
      'postperpage' => '3',
      'category' => '',
      'tag '=> ''
        ]
]);

also changed in headers(Content-Type), but something is still an empty result.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question