Is there a web service standard (API) or best practice for developers?

If you are planning to start developing an API for your web application. Are there any guidelines, guidelines, or standards for building web services. I have seen several discussions on this topic, and I would like more information.

At the very least, get pointers to where to get the information.

Thanks in advance.

+6
web-services
source share
3 answers

API 101

I am inserting this URL as a close approximation to a possible answer. Since I have not received any other answer, I think it is as close as possible.

I would like to receive a more detailed review of best practices, if someone finds something better, let me know to mark their answer, as usual.

+1
source share

There is a wide variety and breadth in relation to "web services." It’s very useful for me to clearly indicate what we are talking about:

web = transported over HTTP(S) service = remote procedure call (RPC) 

Note that the HTTP (S) part of this simply indicates the transport medium, but not the content. Also note that part of the RPC of this simply indicates behavior (essentially calling a remotely named function with arguments that return a result), but not the contents.

A critical question arises: do you control both sides of the communication. If so, but especially if not, you should be concerned about interoperability.

SOAP is a standard for implementing a web service that specifies the use of XML with special formatting for request and response content. This is VERY hard and there are still compatibility issues in various implementations.

There are many custom implementations, most of which are easier, but you will almost certainly encounter interaction issues.

Since any form of content can potentially be used to achieve a web service, I recommend choosing one that can handle complex content (to varying degrees), standardized, lightweight and reliable.

I recently leaned towards JSON for the content format. I recommend considering the same, especially if you plan to implement AJAX.

Best wishes.

+1
source share

If you could answer some of these questions, you could get a more satisfactory answer.

  • who is the audience that will consume the service?
  • What types of client technologies will consume the service.
  • What assumptions / limitations can you impose on them (platforms, tools, skills set)?
  • How widely do you use the API - how many methods will it expose?
  • Is safety a consideration - how safe are you?
  • Do you need to support transactions?
0
source share

All Articles