7
Phlisg
5y

Fack I hate this CMS we have. Using Fetch and sending data as encoded JSON doesn't get parsed nor recognized by the CMS. I was pulling my hair out, understanding the differences, switched back to XHR... and then noticed the buggar:

XHR sends data as "FormData()".

I switched everything to FormData and TADAAA IT WORKS MOTHERFUCKA

Lost a whole fucking day on this trying to understand whether it was my code or the CMS the problem.

Ah yes, of course, I had to reproduce the CMS on my machine, instead of having the developers lend us a "development" platform on it, so obviously I don't know what's happening under the hood :))))))))

Comments
  • 3
    well done.

    Figuring out the proper format can be a real pain in the ass, particularly with x-www-form-urlencoded, god what a piece of shit that experience is.
  • 0
    @erandria thanks!

    it's these little things that eventually you get aquainted with, go around them and remember about them for next time!

    But also working with a CMS which imposes you limits (as you can't code directly on it, only in twig...), is very cumbersome
Add Comment