accept
Returns a collection of MediaTypePreference
s specified by this HTTP message’s "Accept"
header.
var accept: [HTTPMediaTypePreference] { get }
You can access all MediaType
s in this collection to check membership.
httpReq.accept.mediaTypes.contains(.html)
Or you can compare preferences for two MediaType
s.
let pref = httpReq.accept.comparePreference(for: .json, to: .html)