AJAX POST over GET Jul07 '06

One problem I have with using "GET" AJAX requests is that the data sent over is transmitted as it would be in a URL string, meaning you have to watch out for invalid characters, such as #, &, etc.

On typical web forms, where the user is allowed to enter whatever they want, there is no way to be sure they won’t enter invalid characters.

However, when using "POST" AJAX requests, there are no such worries.

I’m beginning to think it’s better to just submit everything as "POST," except for the simplest of data (like a single number or letter).

Not to mention - I almost forgot, a "GET" AJAX request is limited to a certain number of characters, and server restrictions, whereas a "POST" request has no such limits.

Are there any advantages to using "GET?"

Categories: Web Development

Add Feedback (view all)

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

None. Because you should be validating any input from the user. The only instance in which I can see it being better is if you want to allow the us ... Read more.

Well I was thinking from more of a "convenience" perspective - not security. If I can submit everything via "POST" and not have to check for invali ... Read more.

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

Similar Entries

Stats

26 unique visits since August 2008

Syndicate

Advertisements