Hi, I wonder if someone could give me some guidance on the streaming API to which I am connected and receiving data, but it is seemingly fragmented.
What I mean by this, is that I am getting responses like this:
I have truncated the message responses here for brevity. The first message is complete, then subsequent messages are partial but always end at the end of the JSON packet. The first part of the data is simply ‘missing’. At various stages, a full and complete message is received again, but followed by incomplete data.
This is my first time dealing with an open-ended stream and so I am obviously missing something.
This is my code - in .NET, using a HTTPWebRequest and Response
response = request.GetResponse()
Dim sr As New IO.StreamReader(response.GetResponseStream(), detectEncodingFromByteOrderMarks:=True)
Is reading the stream by line the culprit? If so, what is the correct way of pulling the data out of the stream?
Thanks in advance for any assistance on this.