OBEX trial and error
I’m toying with an app for talking with my Ericsson T68 cellphone using the OBEX protocol, and just now I realized that the reason why it responded with “Bad Request” when I tried to send a vCard to it, was that the request lacked the MIME type header. None of the examples in the OBEX protocol spec use it, so …
Speaking about OBEX, they say that they have modeled it conceptually after the HTTP protocol, which is basically a bunch of headers followed by a body. When you visit a web page the body of the request contains something like “GET /path/page.html HTTP/1.1” and the preceding headers contain cookies, info about language preference, referrer, accepted file types, the length of the body, etc.
The response contains headers for setting new cookies, info about character set, body length, etc, followed by the body which is the HTML for the page. Anyway, the OBEX protocol is binary, since it is intended for limited bandwidth and devices with small memories. However, the strange thing is that the OBEX packet only has headers, and that the body is said to be just one of many headers. How can something have headers when there’s nothing to “head”? It would’ve been funnier to call them all “footers”.