Comments (5)
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.
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.
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.
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.
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)
- Implement Python Unit Tests HOT 1
- Package new version HOT 3
- No JSON object could be decoded HOT 4
- Setting caching = True causes AttributeError: 'Response' object has no attribute 'getvalue' HOT 4
- The server runs ik but the authorizer class you provided doest seem to work.I can still access my model without login. HOT 7
- Detailed Documentation HOT 10
- Problem with POST method HOT 7
- use <list> for metadata HOT 1
- ETag / If-None-Match support HOT 4
- JSON usage HOT 2
- Nested results using reference property HOT 5
- Initial Setup & Install HOT 2
- Allow using key name (or integer ID) when referencing entities HOT 3
- JSON Query responses that return one data object are not correctly serialised HOT 2
- GET Broken: Syntax error introduced in r121 HOT 1
- TypeError: unbound method set_response_content_type HOT 1
- Remove "Item" nodes in json HOT 12
- Paging and memcache HOT 1
- Need to return a count of the results in total. HOT 2
- Uploading images to BlobInfo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appengine-rest-server.