News for hackers. Stuff that matters.
Re:Dropbox API v2 launches by pixie_ on Wednesday November 04, 2015 @02:36PM (#10509015)
A simple POST based API? What is this blasphemy?
Re:Dropbox API v2 launches by conradk on Wednesday November 04, 2015 @02:50PM (#10509123)
As long as everything is well documented, I don't see the problem. With most languages, you'll probably want to use an SDK anyway.

What's the problem with a POST based API?

Re:Dropbox API v2 launches by waterside81 on Wednesday November 04, 2015 @04:12PM (#10509801)
pixie_ was being sarcastic - alluding to how "RESTful" APIs with the wide array of verbs is en-vogue in some circles.
Re:Dropbox API v2 launches by smizell on Wednesday November 04, 2015 @02:45PM (#10509075)
It is interesting that you request the /get_account link with a POST method.
Re:Dropbox API v2 launches by ajkjk on Wednesday November 04, 2015 @02:48PM (#10509108)
As systems grow you always end up wanting to parameterize GET apis with things that you can't reasonably continue to stuff into headers, matrix params, and a wonky URL (in my experience).
Re:Dropbox API v2 launches by dragonwriter on Wednesday November 04, 2015 @03:05PM (#10509226)
Which is why we need to get rid of the WebDAV baggage around the SEARCH method [0] and establish a general-purpose, safe/idempotent HTTP method that accepts a message body to supply parameters rather than using URL query strings; a draft RFC for such a method exists. [1]

[0] https://tools.ietf.org/html/rfc5323

[1] https://tools.ietf.org/html/draft-snell-search-method-00

Re:Dropbox API v2 launches by tlb on Wednesday November 04, 2015 @02:53PM (#10509144)
And especially, browsers limit URLs to as small as 2 kB. They go into more detail on this design decision here: https://blogs.dropbox.com/developers/2015/03/limitations-of-...
Re:Dropbox API v2 launches by lucian1900 on Wednesday November 04, 2015 @03:07PM (#10509238)
GET requests can have a body. Some clients fail at handling this and you have to use method overrides, though.
Re:Dropbox API v2 launches by awinder on Wednesday November 04, 2015 @04:28PM (#10509914)
GET requests can have a body but by spec they aren't supposed to parse it with the request

https://groups.yahoo.com/neo/groups/rest-discuss/conversatio...

Re:Dropbox API v2 launches by prodigal_erik on Wednesday November 04, 2015 @04:29PM (#10509921)
We have fifteen years worth of client and proxy implementations that do not support GET with a request body. This ill-conceived spec change violates "be conservative in what you send" just to avoid adding a new idempotent request method that actually defines usable semantics for its body.
Re:Dropbox API v2 launches by sk5t on Wednesday November 04, 2015 @10:27PM (#10511458)
If I had to consume an API with entity-body-having GETs, I would definitely conclude the designers had no practical experience in the field, and had read about this obscure possibility somewhere...
Re:Dropbox API v2 launches by cunac on Wednesday November 04, 2015 @03:40PM (#10509529)
in this case there is no reason to do that and you lose all possibilities of using cache if that is desirable

GET /users/@me/accounts/:id --> specific user account GET /users/@me/accounts --> all user accounts

would suffice and would read naturally , it would also give you ability for other user with appropriate credentials (admin kind) to see some other user account information yes, very disappointed with design decisions (I understand that from a purist perspective URI is opaque but well named URIs help communication with people)

Re:Dropbox API v2 launches by ajkjk on Wednesday November 04, 2015 @04:37PM (#10509967)
My point is that in complex systems 'get' use cases come up that don't fit well in urls.

Suppose you have too many accounts to list, so you start taking predicates in the API, or you start returning a pagination token that's passed back in on a subsequent requests. You quickly overwhelm URIs and have to start serializing complex objects in headers or query params. Eventually you give up and switch to POST so you can just post a json body and be done with it.

Re:Dropbox API v2 launches by cunac on Wednesday November 04, 2015 @07:33PM (#10510811)
I do build a complex systems and pagination payload always have links to prev/next etc. , POST for GET would kill all client side and server side caching we leverage and would make system really hard to scale. We still didn't run into compelling case to use POST for this type of fixed queries.

What you are talking is ad hoc search capability and that is usually done differently either by posting content type which indicates search payload or using different generic URI for search queries within a whole system