Thursday, February 23, 2012

Http headers is a worn out technology

The new model is peer to peer, everyone has their own server on their computer. The browsers still act like the old technology client server, they send tons of useless header information. They tell me I cannot turn this off, so your local machine will plow through the useless headers.

So, I have no code yet to plow through headers, and my 10 line magic header wont't work with browsers. My browser tries, I can read all of its information in the engine. They tell me to look for, Content-Type:application/json, white space removed I presume. Then when I find that, I cannot rely on byte count from the browser if it is streaming Json. I have to count brackets, the way I do it at the console.

But I found a program, fiddler, I can construct ad hoc http headers and test them. The machine works, just needs to plow a bit. I think its important to get this connect to the browser.

The strategy here has got to be a reliable Json send and receive from the browser, I move that up in priority.
So I fixed it using strstr, the wonderful little string routine. It finds my magic header and ignores the others: strstr(header,"Content-Type"application/json"); Since I can't rely n content length, I just count brackets and collect.

No comments: