Sunil tc
Sunil tc

Reputation: 2612

Get the data posted to URL in laravel

I'm using an API, for which i'm passing callback url. To this callback url data will be posted from api.

How can I get this data from callback url.

This is my code.

In response data is not there.

public function getData(Request $request){
    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'api?callbackurl=url/getData'
            ]
        ]);
  }

Upvotes: 0

Views: 351

Answers (1)

Alexey Shokov
Alexey Shokov

Reputation: 5010

You callback URL is just another Laravel action. Create an action for url/getData (but you probably should to full URL instead) and wait for the data there.

Upvotes: 1

Related Questions