CircleOfNice / DoctrineRestDriver

GNU General Public License v3.0
153 stars 44 forks source link

Can't make insert when calls to API make with Doctrine Api Plataform. Shows MIME not supported error. #75

Open Bizkaitarra opened 6 years ago

Bizkaitarra commented 6 years ago

When I try to use this driver to call an standard Doctrine API plataform works well with selection operations but I can't make any insert.

When I try to insert API complais about the MIME Type:

The content-type \u0022application\/x-www-form-urlencoded\u0022 is not supported. Supported MIME types are \u0022application\/json\u0022

I tried to make Doctrine API Plataform to work with x-www-form-urlencoded but I can't:

https://api-platform.com/docs/core/form-data/#accept-applicationx-www-form-urlencoded-form-data

¿Is there anything I can configure in Doctrine Rest Driver to send request using json and not x-www-form-urlencoded?

TobiasHauck commented 6 years ago

As you can see here: https://github.com/CircleOfNice/DoctrineRestDriver/blob/master/Types/CurlOptions.php#L35

The drivers default content-type is application/json

So if it's not sending json you may override that somewhere in your application. What's your drivers config? Can you show me?