0

We are building a POS tablet system between server and android system using android studio. Which one is better in sending json data into the server ? Is it Using POST or header content ? And which one is more reliable ?

Konz Mama
  • 975
  • 2
  • 8
  • 26
  • Java and JavaScript tags? Anyhow, use headers for small amounts of meta-data, and POST body for large amounts of data. Related: [Maximum on http header values?](http://stackoverflow.com/questions/686217/maximum-on-http-header-values) – Alexander O'Mara Apr 11 '16 at 03:36

1 Answers1

1

I think what you really are asking is this:

When send data from a client to a server via HTTP, should the data of the POST request be in the body or can it just be inside a header?

While you technically can put data in the headers, it's more standard to have the core data of the message should be in the body of the POST. The headers exist to describe the data (e.g. Content-Length, Content-Encoding, etc...) or ancillary data (e.g. authentication token). Also, the headers are typically understood to be readable strings, while the body of the POST can have binary data or alternate encodings (as specified by the headers).

selbie
  • 100,020
  • 15
  • 103
  • 173