connect-requires-json

Error middleware for empty and non-JSON request bodies

Usage no npm install needed!

<script type="module">
  import connectRequiresJson from 'https://cdn.skypack.dev/connect-requires-json';
</script>

README

connect-requires-json

JavaScript Style Guide Build Status Coverage Status

This middleware will validate incoming request bodies, throwing a 400 when the body is empty and 415 when the Content-Type header does not contain json.