g_b
g_b

Reputation: 12428

Is there any disadvantage in using POST to retrieve data instead of GET in jQuery Ajax requests?

Is there harm ind doing so? Sometimes, I want to retrieve data parameters are too long and I don't want it to show in my URL so I use POST. Should I not be doing this? If so, for the case that I mentioned, how would you go about the long query string?

Upvotes: 1

Views: 237

Answers (1)

Jacob
Jacob

Reputation: 78850

The inability for caching to take place is one disadvantage. Another is that it may violate the principle of least surprise; people expect GET for getting data usually.

To avoid a long query string, one approach is to consider whether it makes sense to integrate your parameters into your path instead of query string parameters.

Upvotes: 2

Related Questions