G
G
GrimJack2017-03-22 17:55:15
Web development
GrimJack, 2017-03-22 17:55:15

Why is a post request not being sent to guzzle 6?

You need to send a post request from the Laravel application to a separate url. So that the receiving side receives it in $_POST['inputData']
I do this ($data is a json string):

$client = new Client();
$request = $client->post($url, NULL, ['insertData' => $data]);

However, $_POST is empty on the receiving side.
What am I doing wrong? There is nothing in the documentation about this, only on examples of get requests, which is not close to my case

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2017-03-22
@GrimJack

$client->request('POST', '/post', [
    'form_params' => [
        'foo' => 'bar',
        'baz' => ['hi', 'there!']
    ]
])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question