Introduction to best practices and best practices of REST interfaces for Spring Boot Development
This article introduces the best practices for developing REST interfaces in Spring Boot and shares them with you as follows:
HTTP verb corresponds to SQL command
GET
Obtain reso
avoid malicious attacks. However, to what extent the number and frequency should be controlled depends on the importance of your API and the load capacity. Each system will have its own judgment, as long as you have mastered this scale, there should be no problem.
In addition, due to browser restrictions, only http get and post methods can be used. If you directly call the rest service through Ajax, when
Best practices for open api application development and best practices for api application development
In the company's internal system, there will be some third-party Data Access scenarios, for example, in Ctrip's app, you can see iron's ticket, you can find the hotel where to go in the Meituan hotel list. This data i
# #-*-Coding:utf-8-*-# # python:2.x# __author__ = ' Administrator '# my_list=[' A ', ' B ', ' C ', ' d '#"""# Most standard programs are built without ignoring usability, see the following example to understand the meaning of the sentence#"""# if ' e ' not in my_list:# my_list.append (' E ')# Print My_list# #[' A ', ' B ', ' C ', ' d ', ' e ']# #这是编写python程序和其他语言相比更加简单的原因之王, when writing a program, ideas can quickly be converted into lines of code# #3点是本章的重点#"""# Use the
REST itself is a design style rather than a standard. REST talks about a very important thing, how to use Web standards correctly, such as HTTP and URIs. The best way to learn about REST is to think about and understand the Web and how it works . If you design an application that conforms to the rest principles, these
Some of the preparatory knowledge required in this article can be seen here: http://www.cnblogs.com/cgzl/p/9010978.html and http://www.cnblogs.com/cgzl/p/9019314.htmlTo establish a Richardson maturity Level 2 post, GET, PUT, PATCH, delete restful API see here: Https://www.cnblogs.com/cgzl/p/9047626.html and https:/ /www.cnblogs.com/cgzl/p/9080960.html and Https://www.cnblogs.com/cgzl/p/9117448.htmlThis article will start the Web
your internal data model and resources already have a good correspondence, API design you still do not need to expose them to one-on. The key here is to hide the internal resources and expose the necessary external resources.In SupportFu , resources are ticket , and user group .Once you have defined the resources you want to expose, you can define the actions that are allowed on the resource, and the corresponding relationships between those actions
pages, totals, and so on, may need to be returned to the previous or next page link. But how do you return this information to the API consumer along with the data from the page?The following is the way to return this data:{ "data": [{Country1}, {Country2} ...], "metadata": {"prev": "/api/...", ...} But doing so causes the body of the response to no longer conform to the Accept header (not the J
Reference effective Objective 2.0 item use clear and consistent naming recommendations1. Method Name: Apply the Hump nomenclature, methods name should be able to show how the method is doing, do not worry about the name process, because when used, Xcode will automatically complete-If methods returns a value, the method name should indicate what the value-Do not use abbreviations-For Boolean property, plus is or has prefix-Do not use the Get prefix-The
noun. Even if your internal data model and resources already have a good correspondence, API design you still do not need to expose them to one-on. The key here is to hide the internal resources and expose the necessary external resources.In Supportfu, resources are ticket, user, group.Once you have defined the resources you want to expose, you can define the actions that are allowed on the resource, and the corresponding relationships between those
to implement the curd functionality of your resources. And here you just need a endpoint:/tickets, no other naming rules and URL rules, cool!The singular plural of this endpointOne rule to follow is that although it seems awkward to use complex numbers to describe a resource instance, unifying all the endpoint and using the plural makes your URL more structured. This makes it easier for API users to unders
. Most of the time the client just needs some of the information, but the interface still transmits all the information, this situation increases the network transmission, especially for mobile applications are particularly unfriendly, but also require the client to extract the required data. Instead of building two APIs that are roughly the same as the return field, it increases the complexity of the backend implementation, either by adding business logic or by increasing the difficulty of main
:/tickets, no other naming rules and URL rules, cool!
The singular plural of this endpoint
One rule to follow is that although it seems awkward to use complex numbers to describe a resource instance, unifying all the endpoint and using the plural makes your URL more structured. This makes it easier for API users to understand and easier for developers to implement.
How do I handle associations? There is al
Rest api parameters and content-type, apicontent-type
When I recently provided rest APIs to the project team, I encountered a problem about interface parameter transfer, mainly because I did not fully consider the usage of third-party callers, we should try to be compatible with the interface call methods provided by the company before, which can reduce the lear
the API type. After the appropriate delay, the program should retry the API call.
API Type
Return Code
message
REST
40000029
Exceeding Tariff limits
Soap
400101
License has exceeded the tariff limit for
Web APIs have become more and more popular in recent years, and the simplicity of API design has become particularly important in multi-backend system interaction applications. In general, RESTful APIs are used as our Web API. This article describes some of the best practices for designing simple RESTful APIs.A noun used instead of a verbUsing nouns to define int
Web APIs has become a very important topic in the last year. We at M-way Solutions is working every day with different backend systems and therefore we know about the importance of a Clean API design.Typically we use a RESTful design for our web APIs. The concept of REST is to separate the APIs structure into logical resources. There is used the HTTP methods GET, DELETE, POST and PUT to operate with the res
First, let's talk a little nonsense:
1. For the name tonylpProgramFrom the employee's perspective, I like to write tonylp, using the camel method, but I don't know what it was for at that time. The name of the blog garden will be changed to tony_lp. If I remember correctly, this should be a naming method in C ++. You are welcome to shoot a brick, because I can't remember it.
2. I like the blog park very much. There are a lot of big cows in this pl
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.