Skip to content

Support Accept header on HTTP server side #88

@VigneshVSV

Description

@VigneshVSV

If clients do not understand the content type that is specified as default for a given property, action or event, provide the response in the content type specified in Accept.

Rough steps:

  • always check if the Accept header does not match the contentType in the (Thing Description) form
  • if they dont match, add a field in the thing_execution_context of the ZMQ scheduling message which states the content type requested. Of course, said content type must be supported in the Serializers singleton. Dont add the info otherwise, send a error response to client instead.
  • if the value is supported, in the RPCServer.run_thing_instance (in hololinked.core.zmq.rpc_server.py), use that content type instead to serialize the payload (not the default content type).
  • on the handler side, as usual, pass the payload in the body
  • update the ZMQ message JSON schema (found as a JSON file under hololinked.core.zmq)
  • add tests and documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersintermediateintermediate level good first issues, might be little harder to complete

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions