node-wot
node-wot copied to clipboard
refactor: use a default contentType of application/json in Forms
As discussed in https://github.com/eclipse-thingweb/node-wot/pull/1175#discussion_r1409109652, this PR includes a proposal for making the contentType
of the Form
class non-nullable by defaulting to application/json
when no Content-Type is passed to the constructor.
This change has the nice effect of getting rid of a lot of nullish coalescing which is currently required to arrive at the default value which had the potential for causing some inconsistencies across the codebase.