1. Return code, I usually use 0 and 1, success is 0, failure is 1, this is how everyone usually writes it.
2. Also, for the sake of interface security, how do everyone sign?
1. Return code, I usually use 0 and 1, success is 0, failure is 1, this is how everyone usually writes it.
2. Also, for the sake of interface security, how do everyone sign?
Restful and Oauth available
The return code can be segmented according to the business definition, instead of simply 0, 1. This will be clearer
Return code: It is recommended to discuss this with the web front-end/App developer. It is easy to say that the request is successful, but there are many reasons for the error. Breaking it down is more beneficial to debugging. Otherwise, if you return a 0, the client will not know it. Is there an error in my own request or is there an error in the server?
Interface security: Try HTTPS encrypted traffic and authenticate the request at the same time. Our backend sends a Token to the client after verifying the user's identity. It uses the Token to verify the user's identity and at the same time authenticates the native client request Header information. Some modifications have been made, and those that do not comply will be filtered out.
Look this may help you:
http://developer.qiniu.com/ar...
1. Signature verification I currently use a combination of oAuth2.0 and HTTP authentication mechanism. You can refer to JWT authentication
2. Return code. This usually needs to be discussed with your interface requester or unilaterally. Determine a standard for them. I am currently using HTTP status code as the return code. Every programmer understands HTTP status code, which saves planning time and time to connect with this aspect.