1

I have this route

 Route::post('exclusive-zone', 'SiteController@postExclusiveZone');

which gets a POST request from a redirected URL from another application in a different domain.(Think redirect of paypal after payment). But I get a

 MethodNotAllowedHttpException in RouteCollection.php line 201: 

Trying to change it to

 Route::get('exclusive-zone', 'SiteController@postExclusiveZone');

returns a success, but of course, I cannot retrieved the POST-ed data.

I tried also working a plain PHP,

 <?php
 echo $_POST['data'];
 ?>

displays the 'data', so the redirect sends a POST. Can someone explain?

update:

tried

Route::any('exclusive-zone', 'SiteController@postExclusiveZone');

this is what I get with Log::info($request)

 [2015-09-08 13:43:52] local.INFO: GET /exclusive-zone HTTP/1.1
sazoo
  • 127
  • 1
  • 2
  • 9

1 Answers1

0

I don't think the redirect is sending post request but posting data with a GET request

Sending POST data with GET request valid?

Community
  • 1
  • 1
Leo
  • 1,521
  • 12
  • 18
  • will $_POST still work if the servers POSTed the data via GET? – sazoo Sep 08 '15 at 16:07
  • Couldn't give you an answer tbh? When you post to get what does the request object contain? – Leo Sep 08 '15 at 16:10
  • Third party cant do a proper post? When you say empty do you mean the Laravel request object is empty? http://laravel.com/docs/master/requests#accessing-the-request – Leo Sep 08 '15 at 16:38