1. return code. I usually use 0 and 1, and the success is 0. all failures are 1. how do you write them. 2. for interface security, how do you sign a signature. 1. return code. I usually use 0 and 1, and the success is 0. all failures are 1. how do you write them.
2. for interface security, how do you sign a signature.
Reply content:
1. return code. I usually use 0 and 1, and the success is 0. all failures are 1. how do you write them.
2. for interface security, how do you sign a signature.
Available Restful and Oauth
The return code can be segmented according to the business definition, instead of simply 0, 1. this will be clearer.
Return code: We recommend that you consult with the Web front-end/App developers. the request is successful, but there are many reasons for the error. it is more advantageous for debugging to be subdivided, otherwise, you will return a value of 0, and the client will not know whether the request has an error or the server has an error.
Interface Security: try HTTPS encrypted traffic and perform authentication on the request. our backend sends a Token to the client after verifying the user identity, and verifies the user identity with the Token, at the same time, some modifications are made to the native client request Header information, and any non-conforming information will be filtered out.
It helps you to see this:
Http://developer.qiniu.com/ar...
1. signature verification I currently use a combination of oAuth2.0 and Http authentication mechanisms. for details, refer to JWT authentication.
2. the return code, which is usually discussed with the demand side of your interface or you will unilaterally determine a specification for them. I am using an HTTP status code as the return code, each programmer understands the HTTP status code, saving the time required to connect the planning time to this aspect.