Tell us what’s happening:
It says,
A request to /api/whoami should return a JSON object with your IP address in the ipaddress key.
A request to /api/whoami should return a JSON object with your preferred language in the language key.
A request to /api/whoami should return a JSON object with your software in the software key.
but my website(https://wyrlv.xyz/api/whoami) is exactly json object.
I’m using Laravel(PHP Framework).
Here is my code:
Route::get('/whoami', function(){
return response()->json( [
'ipaddress' => $_SERVER['REMOTE_ADDR'],
'language' => $_SERVER['HTTP_ACCEPT_LANGUAGE'],
'software' => $_SERVER['HTTP_USER_AGENT']
]);
});
Challenge: Request Header Parser Microservice
Link to the challenge: