I have a webpacked client application running on localhost:8080 and an Silex PHP application running with apache on localhost:80
I try to send a PUT request with axios on the client to the silex application with a request payload. But somehow in the silex application I see no payload, the request parameters bag is empty.
This is my vHost CORS config:
Header always set Access-Control-Allow-Origin "http://localhost:8080"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, x-requested-by, Content-Type, origin, authorization, accept, client-security-token"
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
And these are the request and response headers.

I really don't know what is missing here, I never had any problems with this.
Solved
I finally found the answer. Turns out that Silex just does not support JSON formatted content on a request.
Comments
Post a Comment