1

Assuming we want to send the some data from a device (IOT) to our server. Small no. of variables (say 10 to 20) but updated per second. So sent to the server a large no. of times. (Say 60 times a minute) What should I use so that minimum of my data pack is used. (Sending using GPRS) GET or POST?

Abhishek Kanthed
  • 1,744
  • 1
  • 11
  • 15

2 Answers2

2

UPDATE :

You should check this thread : Why GET method is faster than POST?

In fact POST use a little bit more data because the header contain some more info like the type of content and it's length

POST /blog/ HTTP/1.1
Host: host.com
Content-Length: 27
Content-Type: application/x-www-form-urlencoded

name1=value1&name2=value2

OLD :

GET requests:

GET /blog/?name1=value1&name2=value2 HTTP/1.1
Host: host.com

POST requests:

POST /blog/ HTTP/1.1
Host: host.com
name1=value1&name2=value2

As you can see there is no big difference in term of length so both request should use the same ammount of data. GET have some limitaion for the url length (2048) and it can only contain ASCII

Source : http://blog.teamtreehouse.com/the-definitive-guide-to-get-vs-post

Cyrius
  • 329
  • 2
  • 4
0

Well technically and according to multiple answers in this question : When do you use POST and when do you use GET?

GET is generally used to retrieve data from a server and POST to submit data to a server. So in your use case you might want to use POST instead of GET.

But generally POST is slower and would be bigger in size than a GET request. That is if the data send in both requests is identical.

A1RStack
  • 75
  • 1
  • 6