title: What is the best practice in REST-Api, to pass structured data or key-value pair?
body: <p>I have a data-structure similar to the given below, which I am supposed to process. I am designing an API which should accept a POST request similar to the one given below. (ignore the headers, etc)
  <br>
  <code>
  {
      "Name" : "Johny English",
      "Id": "534dsf",
      "Message":[
          {
              "Header":"Country of origin",
              "Value":"England"
          },
          {
              "Header":"Nature of work",
              "Value":"Secret Agent/Spy"
          }
      ]
  }
  </code>
  <br></p>
  
  <p>Some how I do not feel, its a correct way to pass/accept data. Here I am talking about structured data vs. Key-Value pair. While I can extract the fields ("Name", "Id") directly to an object attributes, but for Key-Value pairs, I need to loop through the collection and compare with strings (eg. "Nature of Work") to extract values.
  <br>
  I searched few sites, looking for any best practices, could not reach into any conclusion. Is there any best practice, suggestions etc. </p>