cowboy_req:version(3)

NAME

cowboy_req:version - HTTP version

DESCRIPTION
    version(Req :: cowboy_req:req()) -> Version :: cowboy:http_version()

Return the HTTP version used for the request.

The version can also be obtained using pattern matching:

    #{version := Version} = Req.

ARGUMENTS

Req
    The Req object.

RETURN VALUE

The HTTP version used for the request is returned as an atom. It is provided for informative purposes only.

CHANGELOG
    • 2.0: Only the version is returned, it is no longer wrapped in a tuple.
    • 1.0: Function introduced.

EXAMPLES

Get the HTTP version
    Version = cowboy_req:version(Req).

SEE ALSO

cowboy_req(3)