Content Type : x-www-form-urlencoded, form-data and json

Raja Jawahar
1 min readApr 16, 2018

--

Basically there are three ways to send the HTML data to the server

  1. application/ x-www-form-urlencoded
  2. multipart/form-data
  3. application/json

There are few differences between each Content-Type

  • First lets take x-www-form-urlencoded, the data becomes key, value separated by & when there are multiple data. For example, if you are sending two key values in a form. Ref 1.0
1.0

Data will be sent as(SITEID=BEDFORD& STOREROOM=CENTRAL). It is similar to the params in get request.

  • form-data, the data is sent in chunks. Conventionally people use this to upload files (like Images,Audios,etc ). Ref 1.1
1.1
  • application/json, the data will be in JSON format.Ref 1.2
1.2

--

--