What data formats can AJAX transfer?

后端 未结 7 1860
梦毁少年i
梦毁少年i 2021-02-06 01:33

I\'m new to AJAX, but as an overview I\'d like to know what formats you can upload and download. Is it limited to JSON or XML or can you even send binary types like MP3 or UTF-8

7条回答
  •  伪装坚强ぢ
    2021-02-06 02:13

    Since data is transported via HTTP you will have to make sure that you use some kind of encoding. One of the most popular is base64 encoding. You can find more information at: http://www.webtoolkit.info/javascript-base64.html

    The methodology is to base64-encode the data you would like to send and then base64-decode the data at the server(or the client) and use the original data as you intended.

提交回复
热议问题