Search code examples
jsonsymfonyresponseseparatoroneupuploaderbundle

Symfony Oneup_uploader bundle, problem wenth generating url in response: \/ separator instead of /


I've followed the documentation of the symfony's bundle oneup_uploader for uploading file to a specific endpoint.

It work well, but when i try to send a response on my listener, like an url and when i try to add field 'url' in my response, it return me an url like that: url/someurl instead of url/someurl. Instead of / i got \ / , but if i dump this, i got the right url with \ / instead of this /. It only happen in the return of the response array..

If i just dump that the link work fine.

It's because i'm returning a plain text instead of a json, but i don't understand why i'm returning a plain text instead of json. How can i configure oneup_uploader to return a json response instead of a plain text ?


Solution

  • I added header parameter "Accept : application/json" and works perfectly