Strange response from server

84 views
Skip to first unread message

Pontus Oldberg

unread,
Nov 18, 2013, 9:03:21 AM11/18/13
to sens...@googlegroups.com
Have anyone here worked with the last_event method in the api ? I am receiving a strange response on my GET request.
Below is the request that I am sending, and the response that I am getting. Notice the "a7" and "0" symbols enclosing the json response.
The documentation for this method does not mention anything about the json response being enclosed by any characters at all. But if there were any characters I would have expected them to be "[" and "]" for conistensy with the events method.

Does anyone know anything about this ?

GET /feeds/<my feed>/last_event/?sense_key=<my key> HTTP/1.1
Host: api.sen.se
Content-Type: application/json
Content-Length: 0
Connection: Keep-Alive
 
HTTP/1.1 200 OK
Server: nginx/0.7.65
Date: Mon, 18 Nov 2013 13:41:49 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Authorization
 
a7
{
    "publish_id": "004eaee7478d026",
    "value": "19.5",
    "timetag": "2013-11-11T22:43:04+00:00",
    "feed_id": 45930,
    "id": 1444893406,
    "unit": "°C"
}
0

Roland

unread,
Nov 18, 2013, 5:44:38 PM11/18/13
to sens...@googlegroups.com
Looking at the response on a windows box, I measure the message length as 173 bytes between and including the curly brackets. if I change the line endings from CRLF to LF the length is 166. by coincidence that is 0xA6. 

I surmise the A7 is the message length provided by whatever mechanism you use to get the result. Don't know what the following '0'  is; maybe a nul terminator?

HTH

Roland
Reply all
Reply to author
Forward
0 new messages