Reputation: 41400
I've created a webhook endpoint and now receiving requests with my Laravel application.
If request comes with the form data, I use $request->post();
, if it has a json body I use $request->getContent()
.
I understand that there may not be both. Right?
My question is - how can I check if response comes with the form data or json body?
Upvotes: 0
Views: 2227
Reputation: 11
I understand that you want check , whether request is Ajax or form data?
You can check this by using:
$request->ajax()
Or by http headers.
Upvotes: 1