Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hartror
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
121.
▲
by
hartror
11y ago
Some background: https://facebook.github.io/react/blog/2015/05/01/graphql-int...
122.
▲
by
hartror
11y ago
The xAuth authentication method is suspect as well: xAuth provides a way for desktop and mobile applications to exchange a username and password for an OAuth access token. Once the access token is retrieved, xAuth-enabled
123.
▲
by
hartror
11y ago
It gets even better: > If the response is not valid JSON, it should be interpreted as an HTTP 503 "Service Temporarily Unavailable" error, and the request should be retried later. Why not just return 503?
124.
▲
by
hartror
11y ago
> In 2005, during Wikipedia’s peak years, there were months when more than 60 editors were made administrator — a position with special privileges in editing the English-language edition. For the past year, it has sometimes struggled to
125.
▲
by
hartror
11y ago
Yeah this is how you do it. You can also use feature toggles to help manage this. http://martinfowler.com/bliki/FeatureToggle.html
126.
▲
by
hartror
11y ago
This is quite an old post relative to the age of ECS, closer in time to when it was announced than now.
127.
▲
by
hartror
11y ago
It is like someone videoed a VRML world.
128.
▲
by
hartror
11y ago
I think some these statements aren't right: > the response to a POST is supposed to be a Location header of the created record The HTTP spec says otherwise: The action performed by the POST method might not result in a resou
129.
▲
by
hartror
11y ago
Why do you not find value in hypermedia? Do you have tightly coupled servers and clients?
130.
▲
by
hartror
11y ago
Querystrings for resources are technically okay in REST: > The query component contains non-hierarchical data that, along with data in the path component (Section 3.3), serves to identify a resource . . . source: https://tools
131.
▲
by
hartror
11y ago
Yes I seem to have misinterpreted your response. Apologies.
132.
▲
by
hartror
11y ago
> The PUT method requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. So PUT either creates or replaces a resource. Definition of repl
133.
▲
by
hartror
11y ago
It seems to be that many of the comments on this and other API posts recently are by people who have never had to integrate with some else's "mostly REST but only when it suits me" API. If the API you are writing has these fe
134.
▲
by
hartror
11y ago
It isn't just a convention, the reasons for doing this are laid out in the HTTP 1.1 spec and assumed by servers, proxies, browsers, clients and developers. For example if I hand someone an API with a URI that accepts a PUT they know th
135.
▲
by
hartror
11y ago
I haven't, you are right I probably should. But it wasn't hard to find something about standard methods and media types. > REST enables intermediate processing by constraining messages to be self-descriptive: interaction is sta
136.
▲
by
hartror
11y ago
Probably because not only is the proposed API not REST it isn't even HTTP.
137.
▲
by
hartror
11y ago
DELETE is idempotent to quote a Stack Overflow answer on the subject: > Idempotence refers to the state of the system after the request has completed > ... > The key bit there is the side-effects of N > 0 identical requests is t
138.
▲
by
hartror
11y ago
Just because a thing, such as a draw or a shuffle isn't a physical thing doesn't mean it cannot exist as resource. Programming is all about creating abstractions, so why cannot I create a shuffle or a draw resource? I could even r
139.
▲
by
hartror
11y ago
I've yet to see a case for PATCH that couldn't be solved with more clarity for everyone involved by a new resource.
140.
▲
by
hartror
11y ago
I agree though I expect Fowler may argue that that is what the HTTP verb OPTIONS is for. Amundsen on the other hand likes his hypermedia more explicit and I tend to agree with him.
141.
▲
by
hartror
11y ago
Resource oriented and its implication of nouns as opposed to verbs doesn't have to equal CRUD. I can see a case for bending the nouns rule of thumb in this domain, for example I might have an api like so: POST /decks : retur
142.
▲
by
hartror
11y ago
As others have pointed out the HTTP verbs have meaning at a protocol level, trying to match a verb based on its English meaning is fraught with problems. Not least of which is the proxy problem I pointed out in my original comment.
143.
▲
by
hartror
11y ago
I assume you mean what is the benefit of hypermedia? Martin Fowler does a good job explaining it ( http://martinfowler.com/articles/richardsonMaturityModel.htm... ). As does Mike Amundsen ( http://www.infoq.com
144.
▲
by
hartror
11y ago
Nice one! Good on you for building a thing and putting it out there. A few comments/suggestions: * You have DEBUG = True in your production Django config. (eg. http://deckofcardsapi.com/api/ ) * You are mutating st
145.
▲
by
hartror
11y ago
Wow that is insane, got to love politics.
146.
▲
by
hartror
11y ago
I thought I had read it somewhere, but obviously not.
147.
▲
by
hartror
11y ago
I stand corrected! Could have sworn I'd read the eventing method was used but obviously not. Thanks for the comment Jonathan, big fan.
148.
▲
by
hartror
11y ago
This is how the time travel mechanics of Braid were implemented. Record the events, apply those events in a deterministic manner, and then reverse the events to go backwards in time. More generally this is pretty much the event sourcing pat
149.
▲
by
hartror
11y ago
A number of these answers are highly unidiomatic, symptoms of people coming from another language to Python. Trying to shoe horn one language's patterns into another is fraught with problems, not only are you going to be less effective
150.
▲
by
hartror
11y ago
I've seen this distinction made in many "communities" including Ruby, Python and Perl. Perhaps in your domain/language this distinction isn't important but it is for some of us. The patterns you use to work with con
More ›