fromHeader

fun <T> PriorityList.Companion.fromHeader(s: String, parseValue: (String, HeaderParams) -> T): PriorityList<T>(source)

Parses a PriorityList from a header value.

Follows RFC 9110: "Previous specifications allowed additional extension parameters to appear after the weight parameter. The accept extension grammar (accept-params, accept-ext) has been removed because it had a complicated definition, was not being used in practice, and is more easily deployed through new header fields. Senders using weights SHOULD send “q” last (after all media-range parameters). Recipients SHOULD process any parameter named “q” as weight, regardless of parameter ordering." https://www.rfc-editor.org/rfc/rfc9110.html#name-accept


fun <T> SimpleRange.Companion.fromHeader(s: String, valueFromHeader: (String) -> T): SimpleRange<T>(source)