accept

HTTP Accept-* headers parsing.

Latest Version: 5.0.1
hapi-family
Installation:

npm: npm install @hapi/accept

yarn: yarn add @hapi/accept

Module Status:
Version License Node Dependencies Travis End of Life
5.0.1
hapi helmet github logo
BSD 12 Dependency Status Build Status
3.2.4
hapi helmet github logo
BSD 12, 10, 8 Dependency Status Build Status Apr 30, 2020
2.2.2
hapi helmet github logo
Commercial 10, 8, 6 Dependency Status Build Status

Introduction

Accept helps to answer the question of how best to respond to a HTTP request, based on the requesting browser's capabilities. Accept will parse the headers of a HTTP request and tell you what the preferred encoding is, what language should be used, and what charsets and media types are accepted.

Additional details about Accept headers and content negotiation can be found in IETF RFC 7231, Section 5.3.