New answers tagged

5

In general, a Web API is a programming interface that HTML applications can leverage for "external" resources. In practice, an "external resource" is in one of two categories: Web services: These are interfaces generally accessible over the web via HTTP(S) (e.g. REST, SOAP). They're developed by whoever builds or maintains the target server-side ...


1

So what is really a resource, why it should be a mapping to one or more entities and what are some examples? When in doubt about anything relating to REST, consider the question in the context of the web. Here's a flow: I want to read Bob's homepage I know (probably because some other web page told me) that there is a http request handler with the id ...


0

With the second approach there is potentially a performance benefit, because you can update directly the DB without checking if the post is already liked / disliked. (Only an update, versus a SELECT and then an UPDATE) Probably you already know if the post is to be liked or to be disliked, because this action come from a GUI which show only the relevant ...


1

Semantically it is a create or update scenario, which is what PUT (which is also idempotent) means. so make a HTTP PUT request to a single endpoint with the value for like. {like: true} for liking and {like: false} for disliking.


1

With your first scheme, your endpoint is not idempotent (i.e. if you execute it twice it doesn't do the same thing as executing it once). With the latter scheme, you can easily implement it to be idempotent (and potentially use a PUT method). In this case, if the "user" likes something they've liked before, it should just succeed and do nothing. This ...


5

For this answer, I'll assume that the C++ code is ONLY well-tested and perfect security wise. If if would be actually be perfect then you wouldn't have asked this question anyways... This is a general compilation of the first things that came to my head, not a complete list. technical disadvantages of using C++: (or basically any external language addon) ...


3

I do not exactly know what you mean by security risks, with the need to typecheck passed parameters using the is* methods on arguments or obtaining the value representation using the v8::Value, the passed arguments are quite safe to work with. If you are afraid of manual memory management and consider that a risk (which is not even that scary anymore, with ...


0

Wicket has different cycles for building the component tree and rendering it. Understanding those cycles will help you to avoid creating components in the constructor, which the writers of Apache Wicket consider a bad practice because it can potentially increase the size of your session. Try writing code that puts model objects in fields, puts ...



Top 50 recent answers are included