Ajax Commit data 500 error with special characters

Source: Internet
Author: User

Tag: Enc appears transfer record BSP com pos = = Body

The AJAX Request API interface transmits the past data containing special characters, and the AJAX request fails with a 500 error.

Suppose you want to post the data for the past: ==>> {a: ' [email protected][email protected][email protected][email protected]#$#{}|> <? ":": "'}

Solution 1:

Json.stringify (data)

This solution does not need to be processed in the background.

Note: However, there are still 500 cases.

Solution 2:

The foreground processing data: encodeuricomponent (data);

Post-processing of receiving data in the background: a= Server.urldecode (a);

This essay is my study work record, if there is doubt welcome in the following comments, reproduced please indicate the source.

If you have help, please move the mouse to the bottom right to a praise, your support is my biggest motivation.

Ajax Commit data 500 error with special characters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.