2

In J2ME ,Which connection type is better?Get or post.Which one is faster?which one uses less bandwidth?and which one is supported by most of the handsets?What are the advantages and disadvantages of both?

user187074
  • 23
  • 3

3 Answers3

2

Also, see Is there a limit to the length of a GET request? which may be relevant if you plan to abuse GET.

Be aware that network operators (certainly in the UK) have caching schemes in place that may affect your traffic.

Community
  • 1
  • 1
martin clayton
  • 76,436
  • 32
  • 213
  • 198
2

If you look at what Opera Mini does, they only use HTTP POST in their HTTP mode. I think this is a great idea because of the following reasons:

  1. POST's are never cached (according to HTTP spec at least) - this saves you from operator caching etc.
  2. It seems some operators do better with POST's than GET's - this is a feeling I get from what some Nigerian users mention.
  3. Opera has the most installations of any J2ME app in the world most probably, and if they do it, it's probably safer.
  4. No problems with HTTP GET limits on query length.
  5. You can use a more flexible data format if you like that uses less data (no encoding needed on the data as with GET)

I think it's much cleaner, but does require some extra work, e.g. if you are using your HTTP web logs to parse out number of requests per "?type=blah" for example, then you'll have to move that into your site's logic.

David d C e Freitas
  • 7,481
  • 4
  • 58
  • 67
1

If you follow standards get should be used only for data retrieval and post for adding new items. It depends on the server handler implementation which one is faster/slower.

Boris Pavlović
  • 63,078
  • 28
  • 122
  • 148