vapor/http

Prefers property/method on `Request`

Closed this issue · 2 comments

jdmcd commented

In order to determine what the client prefers

looks like NIO is parsing this, but not exposing the APIs to do it. Will need to bring over the code from Vapor 2.

Added in #272, thanks for reporting!

httpReq.accept.mediaTypes.contains(.html)
httpReq.accept.comparePreference(for: .json, to: .html)