Em quarta-feira, 16 de novembro de 2016, ?s 12:03:38 PST, MATTIA ANTONINI escreveu: > Dear all, > I'm writing an IoTivity client (based on version 1.2.0 stable) on Linux and > an IoTivity server based on IoTivity-constrained. IoTivity-Constrained does > not set the Uri-Path CoAP option in responses (I think) because it is not > mandatory. Responses are matched by the client with the CoAP Token. I > investigated a bit, and I discovered that (using the 1.2.0 stable version) > an IoTivity server sends responses with the Uri-Path Option set. > > My question is: is it mandatory that the server responds with the Uri-Path > set in responses? if not, IoTivity should extract the uri by matching the > response with the sent request, and it should set it in OCRepresentation.
They're different things. If you want the URI of the resource you requested, you need to keep track of it. A response containing Uri-Path has a different interpretation. It can be used for the server to report the resource's canonical URI. But if the requested URI is already canonical (or if there isn't any better option), the server need not send it. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
