0

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?

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191

1 Answers1

1

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.