Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response with Content-Type text/html #7

Open
Kelvao opened this issue Jun 21, 2018 · 0 comments
Open

Response with Content-Type text/html #7

Kelvao opened this issue Jun 21, 2018 · 0 comments

Comments

@Kelvao
Copy link

Kelvao commented Jun 21, 2018

Please, change the code to:

$app->add(function ($req, $res, $next) {
$response = $next($req, $res);
return $response
->withHeader('Content-Type', 'application/json')
->withHeader('Access-Control-Allow-Origin', '*')
->withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization')
->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
});
and now will return in json 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant