HTTP Accept negotiation algorithm

zeronone

I am readying HTTP spec document for the Accept header and encountered with the following example.

Accept: text/*, text/html, text/html;level=1, */*

# Precedence
1) text/html;level=1
2) text/html
3) text/*
4) */*

I am wondering what algorithm is used to sort the preference of each content-type? Is there any standard documentation for it? Any reference to some implementation or documentation will be appreciated.

Is it correct to say that under the same quality factor, more specific content-types have higher precedence (application/json > application/*)?

How come text/html;level=1 has higher preference text/html?

Julian Reschke

You're looking at an obsolete spec. See https://greenbytes.de/tech/webdav/rfc7231.html#header.accept for the current one.

In particular:

"Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies to a given type, the most specific reference has precedence..." -- https://greenbytes.de/tech/webdav/rfc7231.html#rfc.section.5.3.2.p.10

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PhpStorm: Algorithm negotiation fail

From Dev

Algorithm negotiation fail in Jenkins

From Dev

JSch Algorithm negotiation fail

From Dev

ssh algorithm negotiation failed

From Dev

Algorithm negotiation fail SSH in Jenkins

From Dev

SharpSSH jsch Algorithm negotiation fail

From Dev

error:Algorithm negotiation fail with SharpSSH

From Dev

JSch algorithm negotiation fail with OSX El Capitan

From Dev

Algorithm Negotiation failed when trying to connect to server

From Dev

SQLDeveloper SSH Connection Algorithm negotiation fail

From Dev

Is there better approach to Accept Header based content negotiation in Spring API?

From Dev

Net:HTTP SSL negotiation timeout on Ubuntu 14.04

From Dev

Netbeans SSH: Cannot connect to server ... Algorithm negotiation fail - how to fix?

From Dev

Can I send http/2 request with OkHttp over NPN Negotiation?

From Dev

Does HTTP content negotiation respect media type parameters

From Dev

Why would HTTP content negotiation be preferred to explicit parameters in an API scenario?

From Dev

Is HTTP content negotiation being used by browsers and servers in practice?

From Dev

How name-lists are separated in SSH2 algorithm negotiation packet payload?

From Dev

JSchException: Algorithm negotiation fail diffie-hellman-group14-sha1

From Dev

How name-lists are separated in SSH2 algorithm negotiation packet payload?

From Dev

Undefined index: HTTP_ACCEPT

From Dev

Dijsktra's Algorithm to accept a single negative edge

From Dev

Dijsktra's Algorithm to accept a single negative edge

From Dev

Extending Illuminate\Http\Request clears Accept header

From Dev

Why Grails ignores the HTTP Accept header by default?

From Dev

There Was No Endpoint Listening at http // That Could Accept The Message in WCF

From Dev

http accept and content-type headers confusion

From Dev

Getting the full HTTP Accept header string in restlet?

From Dev

Http web request Accept and Expect difference

Related Related

  1. 1

    PhpStorm: Algorithm negotiation fail

  2. 2

    Algorithm negotiation fail in Jenkins

  3. 3

    JSch Algorithm negotiation fail

  4. 4

    ssh algorithm negotiation failed

  5. 5

    Algorithm negotiation fail SSH in Jenkins

  6. 6

    SharpSSH jsch Algorithm negotiation fail

  7. 7

    error:Algorithm negotiation fail with SharpSSH

  8. 8

    JSch algorithm negotiation fail with OSX El Capitan

  9. 9

    Algorithm Negotiation failed when trying to connect to server

  10. 10

    SQLDeveloper SSH Connection Algorithm negotiation fail

  11. 11

    Is there better approach to Accept Header based content negotiation in Spring API?

  12. 12

    Net:HTTP SSL negotiation timeout on Ubuntu 14.04

  13. 13

    Netbeans SSH: Cannot connect to server ... Algorithm negotiation fail - how to fix?

  14. 14

    Can I send http/2 request with OkHttp over NPN Negotiation?

  15. 15

    Does HTTP content negotiation respect media type parameters

  16. 16

    Why would HTTP content negotiation be preferred to explicit parameters in an API scenario?

  17. 17

    Is HTTP content negotiation being used by browsers and servers in practice?

  18. 18

    How name-lists are separated in SSH2 algorithm negotiation packet payload?

  19. 19

    JSchException: Algorithm negotiation fail diffie-hellman-group14-sha1

  20. 20

    How name-lists are separated in SSH2 algorithm negotiation packet payload?

  21. 21

    Undefined index: HTTP_ACCEPT

  22. 22

    Dijsktra's Algorithm to accept a single negative edge

  23. 23

    Dijsktra's Algorithm to accept a single negative edge

  24. 24

    Extending Illuminate\Http\Request clears Accept header

  25. 25

    Why Grails ignores the HTTP Accept header by default?

  26. 26

    There Was No Endpoint Listening at http // That Could Accept The Message in WCF

  27. 27

    http accept and content-type headers confusion

  28. 28

    Getting the full HTTP Accept header string in restlet?

  29. 29

    Http web request Accept and Expect difference

HotTag

Archive