0
votes

I have a laravel 5 app and i am making a post request in this way

$client = new Client(); //GuzzleHttp\Client
    $result = $client->post('http://example.com/http_hook/meteor.php', [
     'form_params' => [
        'phone' => '380720011000'
     ]
 ]);

i am receiving the post request this way

<?php

    $post = file_get_contents('php://input');

    $phone = $post['phone'];

How can i consume the post data from laravel? Code for receiving isn't working and throws no error.

1
Could you please let me know the response you get after making the post request ?Jigar
What are you trying to do? Your Guzzle Client is not being fired...idelara

1 Answers

0
votes

form_params option works like a usual form on a web page. So in your second script you don't need to get this data in a special way, just use usual $_POST['phone'] or whatever from your framework.