Search code examples
crossrider

How to use FormData with the crossrider api?


I'm trying to post form data with the content type of 'multipart/form-data' using the crossrider api. If I pass the FormData javascript object to the api it doesn't send the form data correctly.

Does anyone have an idea on how to correctly post that kind of data using the crossrider api?

Thanks


Solution

  • The crossrider request api isn't compatible with the html5 xmlhttprequest2. What means you can't use formData directly with it.

    If you need to upload a file you can consider send it as base64 string using crossrider api, or to try and use the platform specific XmlHttpRequest objects on platforms that supports xmlhttprequest2. it will work on chrome and maybe in the page scope in IE & firerfox but i didn't really check it.