Closed luebbert42 closed 6 years ago
@luebbert42 Try registering following middleware and see the stacktrace in logs. Let us know what is in stacktrace. Here you can verify your each request and it's parameters.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Log;
class LogAfterRequest
{
public function handle($request, Closure $next)
{
return $next($request);
}
public function terminate($request, $response)
{
Log::info('app.request', ['request' => $request->all()]);
// Log::info('app.response', ['response' => json_encode($response->content())]);
}
private function getallheaders()
{
if (!is_array($_SERVER)) {
return [];
}
$headers = [];
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}
issue = bogus
Explanation: The lib seems to return 404 if the request is not valid (I kind of expected another status code in this case).
I wanted to do a quick smoke test if I configured everything correctly and sent a simple "foo=bar" post request via Postman.
To do a valid smoke test I captured the alexa request using requestb.in and posted the JSON as raw request to my url using Postman. This worked.
Thanks for your support, guys, anyway :-)
I am trying to get a "hello world" up and running
in web.php I have included: \AlexaRoute::launch('/your-app-uri', 'App\Http\Controllers\AnyController@anyMethod');
And created AnyController and anyMethod.
When I launch /your-app-uri I am getting a 404. Same when I post something against this URL using Postman. artisan route:list does not show your-app-uri as valid url.
Is this supposed to be like this? Did I miss anything to get the AlexaRouter working?