It's obviously your app that don't deliver a proper POST request. You should probably ask on a forum made for iOS devs, I think you will have better luck there.
mengidd said:
It's obviously your app that don't deliver a proper POST request. You should probably ask on a forum made for iOS devs, I think you will have better luck there.
Actually what I'm trying to understand is what Laravel needs to interpret a request as POST.
Because I'm pretty sure that my app is making a POST request, obviously not a good one, so to fix that I wanted to provide all the information in the request.
Knowing that I can then bind a proper POST request from my app, giving no margin to interpret as a different request.
No idea how Laravel handles request, but one way to see if your app is correctly sending a post request is to hit a page where you return $_SERVER['REQUEST_METHOD']. If it's POST this is a Laravel problem, if it's not it's your app :-)
mengidd said:
No idea how Laravel handles request, but one way to see if your app is correctly sending a post request is to hit a page where you return $_SERVER['REQUEST_METHOD']. If it's POST this is a Laravel problem, if it's not it's your app :-)
I did as you said. I created a php file in my public folder:
post.php
<?php
/**
* Created by PhpStorm.
* User: renato
* Date: 06/01/16
* Time: 18:13
*/
$method = $_SERVER['REQUEST_METHOD'];
$json = json_encode(['response' => $method], true);
echo $json;
When I tried accessing post.php with my app it returned
{ response = POST; }
I'm losing my mind here... I really don't know what the problem is...
Turned out to be a problem with the trailing slash. It was 301 redirecting my post requests to a get request.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community