Code Monkey home page Code Monkey logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
With your accept header, you are indicating that "application/json" and "*/*" 
are equally acceptable.  you can solve the problem by either removing the "*/*" 
or by indicating that "application/json" has a higher preference, e.g.: 
"application/json, */*; q=0.5".

Original comment by [email protected] on 21 Oct 2010 at 11:58

  • Changed state: Invalid
  • Added labels: Type-Other
  • Removed labels: Type-Defect

from appengine-rest-server.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Hi Jahlborn - thanks for getting back so quickly.

It does seem a very strange best match algorithm which 
takes a list of options of the form 'StringA, wildcard' and
does a match against the set (StringA, StringB) and gives
precedence to the wildcard matching StringB over the
exact match StringA.

Is this something that's deep in the bowels of AppEngine?
If so, I might ask some Google folk abt it.

TIA,
Seán.


Original comment by [email protected] on 22 Oct 2010 at 7:44

from appengine-rest-server.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
This isn't an algorithm defined by google, this is an algorithm defined by the 
http spec.  it is implemented as it should be.  see: 
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html .  python implementation 
reference here: http://pythonpaste.org/webob/reference.html#accept-headers .

Original comment by [email protected] on 22 Oct 2010 at 11:59

from appengine-rest-server.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
Hi Jahlborn - thanks again for speedy reply.

If my understanding of the http spec is correct, there seems to be quite
a lot of wiggle room - it's not very specific regarding how this should
be implemented. Further, I'd suggest that the way best_match currently
works is not in the spirit of the spec which makes reference to intelligent
precedence rules.

I'd argue that the precedence rules of best_match are quite unintuitive
and I think the example above is a good example of this.

Further, it is worth noting that there can be problems setting the
accept header in browsers, in particular with jquery

http://stackoverflow.com/questions/1145588/cannot-properly-set-the-accept-http-h
eader-with-jquery

but also more generally

http://www.grauw.nl/blog/entry/470

Not really sure what the best solution should be but just pointing out that it 
is
sometimes difficult to have full control over what the browser sends in
the accept field.

In my app, I'm just dealing with JSON, so I'm just gonna modify the library 
locally to dish out JSON by default rather than XML - probably suboptimal,
but works for me.

BR,
Seán.

Original comment by [email protected] on 23 Oct 2010 at 12:50

from appengine-rest-server.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 18, 2024
okay.  guess you can take that up with the appengine folks.

Original comment by [email protected] on 23 Oct 2010 at 2:10

from appengine-rest-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.