how much of data usage a http post request?

MohammadReza Vahedi

I am writing an application for android and in the app i use some HttpPost requests. i have a service in which i schedule 3 request at constant times. one every 1.5 seconds, one every 7 seconds and one every 20 seconds. most of times web service don't return any thing.

i install my app on a device and check it for 2 days. this app use 40M data although viber use only 4M . (i found it by check data usage part at device settings.)

how much data use by a simple HttpPost request?

how i can reduce data usage in my app ?

Salem

Well, the only person able to find out how much any POST request costs is you. It depends a lot on the headers/data you send.

HTTP introduces some overhead in the data sent. For example, using cURL to post just a pair of values p1=v1 and p2=v2, those are the headers sent:

POST / HTTP/1.1
User-Agent: curl/7.35.0
Host: localhost
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

Those are just the headers (the body adds 11 bytes to this). As you can guess, doing this every 1.5 seconds creates a lot of traffic.

To reduce this, you can do some things:

  • Lower the rate of requests to the server. Do you really need to post every 1,5 seconds?
  • If you post a lot of data, check if HttpPost lets you compress the data you send / the server supports HTTP compression;
  • Consider the usage of other technologies like plain sockets/websockets. If the data you post is small this will help by reducing the overhead of HTTP.

EDIT: I am assuming you are using POST requests to really post data to the server. If you are using it to get some kind of state from the server, something like (Web)sockets or using push notifications can reduce a lot the requests required.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how much of data usage a http post request?

From Dev

How much data transfer does a typical http request generate on EC2?

From Dev

How to send json data in the Http request to POST Method in JSON Parsing

From Dev

How to receive json data using HTTP POST request in Django 1.6?

From Dev

AngularJS $http.post how to set the json data into request body

From Dev

How to send json data in the Http request to POST Method in JSON Parsing

From Dev

How to post params in the body of HTTP post request?

From Dev

JMeter get jdbc request data and send each with http post request in a spring service how-to

From Dev

HTTP POST request with JSON object as data

From Dev

Where is data in angularjs http post request?

From Dev

How can I read the HTTP post request?

From Dev

How to send HTTP POST request in Xamarin?

From Dev

How to send HTTP POST request with AFNetworking?

From Java

How are parameters sent in an HTTP POST request?

From Java

How to make an HTTP POST web request

From Dev

How to write a Serializable as the body of an http post request?

From Dev

How to set the body of a http post request in Matlab

From Dev

How to make 'post' HTTP request in Swift?

From Dev

How to send an http multipart POST request with a Blob in it?

From Dev

how to http:post file with httpc:request in erlang?

From Dev

How to set the body of a http post request in Matlab

From Dev

how to http:post file with httpc:request in erlang?

From Dev

How to send an object to http.post request?

From Dev

How to POST JSON data in body with Jenkins http-request plugin and Pipeline?

From Dev

How is character encoding specified in a multipart/form-data HTTP POST request?

From Dev

Can't understand how to extract post data from ejabberd http request handler

From Dev

How to POST JSON data in body with Jenkins http-request plugin and Pipeline?

From Dev

How to load data into reclyerview while downloading them from post async http request

From Dev

Practical usage of AutoMapper with POST request

Related Related

  1. 1

    how much of data usage a http post request?

  2. 2

    How much data transfer does a typical http request generate on EC2?

  3. 3

    How to send json data in the Http request to POST Method in JSON Parsing

  4. 4

    How to receive json data using HTTP POST request in Django 1.6?

  5. 5

    AngularJS $http.post how to set the json data into request body

  6. 6

    How to send json data in the Http request to POST Method in JSON Parsing

  7. 7

    How to post params in the body of HTTP post request?

  8. 8

    JMeter get jdbc request data and send each with http post request in a spring service how-to

  9. 9

    HTTP POST request with JSON object as data

  10. 10

    Where is data in angularjs http post request?

  11. 11

    How can I read the HTTP post request?

  12. 12

    How to send HTTP POST request in Xamarin?

  13. 13

    How to send HTTP POST request with AFNetworking?

  14. 14

    How are parameters sent in an HTTP POST request?

  15. 15

    How to make an HTTP POST web request

  16. 16

    How to write a Serializable as the body of an http post request?

  17. 17

    How to set the body of a http post request in Matlab

  18. 18

    How to make 'post' HTTP request in Swift?

  19. 19

    How to send an http multipart POST request with a Blob in it?

  20. 20

    how to http:post file with httpc:request in erlang?

  21. 21

    How to set the body of a http post request in Matlab

  22. 22

    how to http:post file with httpc:request in erlang?

  23. 23

    How to send an object to http.post request?

  24. 24

    How to POST JSON data in body with Jenkins http-request plugin and Pipeline?

  25. 25

    How is character encoding specified in a multipart/form-data HTTP POST request?

  26. 26

    Can't understand how to extract post data from ejabberd http request handler

  27. 27

    How to POST JSON data in body with Jenkins http-request plugin and Pipeline?

  28. 28

    How to load data into reclyerview while downloading them from post async http request

  29. 29

    Practical usage of AutoMapper with POST request

HotTag

Archive