Coder Social home page Coder Social logo

Comments (8)

cdh4u avatar cdh4u commented on July 20, 2024

Ok, I found the reason. When looking in Wireshark, the CoAP response indicates a Content-Format value that node-wot does not understand.

To solve this, the CoAP request sent from node-wot would have to indicate that it accepts text/plain.

from node-wot.

6d77 avatar 6d77 commented on July 20, 2024

Hi,

I think you can just do that by specifying text/plain as mediaType in the forms of your property specification in the TD. Default is application/json AFAIK.

from node-wot.

cdh4u avatar cdh4u commented on July 20, 2024

I have the following in my TD:

"forms":[{"href":"coap://193.234.219.199:5683/3303/0/5700","mediaType":"text/plain"}]

But, it does not have any impact on the request.

from node-wot.

6d77 avatar 6d77 commented on July 20, 2024

I just have seen that @mkovatsc commented line https://github.com/eclipse/thingweb.node-wot/blob/20fdc5b2ea0f95e6e2d24d73dd0100e5f7b39e5f/packages/binding-coap/src/coap-client.ts#L191 a month ago. This line had set the Accept option before. We would have to ask him for the reason of this change.

from node-wot.

6d77 avatar 6d77 commented on July 20, 2024

Just talked to him. There was another CoAP server implementation which could not cope with Accept headers, so he removed it to make this working. Until a final solution is found to fit both requirements you might just uncomment the line again locally.

from node-wot.

cdh4u avatar cdh4u commented on July 20, 2024

I think the master branch should be based on endpoints behaving correctly - in this case being able to process the Accept header :)

Anyway, I will see Matthias this weekend, so I can discuss it with him then. Short term I will uncomment the line.

from node-wot.

danielpeintner avatar danielpeintner commented on July 20, 2024

The code
req.setOption("Accept", form.mediaType);
is activated again.

@cdh4u Can we close the issue?

from node-wot.

danielpeintner avatar danielpeintner commented on July 20, 2024

as mentioned the option is in by default now, see https://github.com/eclipse/thingweb.node-wot/blob/6dad9786152e40f939caa7f63ef1abf1769ef316/packages/binding-coap/src/coap-client.ts#L212

from node-wot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.