#857 hisRead POST response

Syd Gillani Mon 28 Sep 2020

Hi,

I need clarification regarding the POST response of hisRead request (I'll talk in Json)

Given /haystack/hisRead?id=@hisId&range=yesterday

The response we get for a single point request is as follows:

    {"meta": {
     "ver": "string"
     "hisStart": "string",
     "hisEnd" : "string"
       },
       "cols": [
              {"name": "ts"},
              {"name": "val"}
               ],
       "rows": [
     {
             "ts" : "string",
             "val": "Any"
     }
     ]
    }


However, what can be the response for the POST request 


{
  "meta": {
    "ver": "2.0"
  },
  "cols": [
    {
      "name": "id"
    },
    {
      "name": "range"
    }
  ],
  "rows": [
    {
      "id": "string",
      "range": "string"
    }
  ]
}

Will it be the list of the single call response For example:

[{"meta": {
     "ver": "string"
     "hisStart": "string",
     "hisEnd" : "string"
       },
       "cols": [
              {"name": "ts"},
              {"name": "val"}
               ],
       "rows": [
     {
             "ts" : "string",
             "val": "Any"
     }
     ]
    }
]

Brian Frank Mon 28 Sep 2020

Are you asking what the format of the POST request is? Its always the same information as you pass in GET. In the case of a hisRead it would look like this in JSON:

{
 "meta": { "ver": "3.0" },
 "cols": [ { "name":"id" }, { "name":"range" } ],
 "rows": [ {"id":"r:xxxx", "range":"yesterday"} ]
}

The response is exactly the same whether you use POST or GET. Note that moving forward, we are going to restrict GETs to only operations without side-effects. So its preferable to use POST all the time.

Login or Signup to reply.