Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Angular 8 CORS error and Missing POST data #666

Closed
ozzpy opened this issue Aug 28, 2019 · 0 comments
Closed

Angular 8 CORS error and Missing POST data #666

ozzpy opened this issue Aug 28, 2019 · 0 comments

Comments

@ozzpy
Copy link

ozzpy commented Aug 28, 2019

Thank you for this thread! It took me forever to figure out that I needed to add BodyParamsMiddleware to my pipeline. I spent about 3 days racking my brain over this until tracing through and figuring out that $request->getParsedBody() was the culprit, returning an empty array.

Originally posted by @ramsey in #371 (comment)

I expend one week with this, try to fetch data from Angular8 and get CORS error
First I had to implement with
//$params = json_decode(file_get_contents('php://input'),true);
//$p2 = Json::decode($request->getBody()->getContents());
but the same url has request from android api, I was almost doing another api url reference when check this out $app->pipe(BodyParamsMiddleware::class); and $app->pipe(CorsMiddleware::class);

@ozzpy ozzpy closed this as completed Aug 28, 2019
@ozzpy ozzpy changed the title I expend one week with this, try to fetch data from Angular8 and get CORS error Angular 8 CORS error and Missing POST data Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant