node-wot icon indicating copy to clipboard operation
node-wot copied to clipboard

refactor: use a default contentType of application/json in Forms

Open JKRhb opened this issue 1 year ago • 2 comments

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.

JKRhb avatar Nov 29 '23 12:11 JKRhb