Development and Learning diary (3): 6 points of experience and 6 points of diary
1. token verification and request response
Token verification. Use the get method. Request entry, using the psot method. A public account or a lightweight application portal is a url. The same url can be divided into get and post. The four parameters are not null and must be verified. Parameters must also be verified during post, but echostr is not output.
During post, echostr may be empty. Do you want to check whether echostr is empty? Since no output is required, verification is not required.2. Access Credential access_token
Each time you get a credential, there is a certain expiration time. That is to say, it can be cached.
I haven't checked the code carefully yet.
3. Message request and response
FromUserName in the request-toUserName in the response
FromUserName when toUserName-response in the request
4. The interface is not an API.It is not very difficult. Many years ago, interfaces provided externally became very popular. APIS, functions, and methods are all input-processing-output.
5. Reuse and basic databaseButtons, menus, XML, and object conversion are reusable basic libraries. With object-oriented, it looks very clear. Different projects can be reused completely.
6. Develop a debuggerThere are quite a few on the Internet, and some people write it on their own.
I used the following:
Http://www.jeecg.org/forum.php? Mod = attachment & aid = token it should be noted that either full token verification is carried in the parameter, or special parameters are added, such as devMode = true, to avoid verification.
I use a method that includes a specific parameter, devMode = true.
Public static boolean checkSignature (TokenCheck tokenCheck ){
If (tokenCheck. getDevMode ()! = Null) {return true;} return checkSignature (tokenCheck. getSignature (), tokenCheck. getTimestamp (), tokenCheck. getNonce ());
} Xiao Lei FansUnion-Founder and owner of Wuhan jiutian bird Technology Co., Ltd.