curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
525 stars 7 forks source link

Add `is()` method to request and responses #75

Closed evert closed 5 years ago

evert commented 6 years ago

Should return true or false if the request or response is of the contenttype specified in is().

Examples that should work if content-type is application/hal+json:

Only xml and json should be supported for the + syntax.

Bonus feature: would be nice if it supports an array of contenttypes too. If more than 1 are passed, it should return true if any of the contenttypes match.