C # process and access HTTP interface requests,
In the era of interface flooding, it is necessary for a programmer to understand and process interfaces!
During the connection, you need to carefully read the documents sent by the other party. If you have any questions, such as encryption, You need to submit a ticket to the other party;
Step 1: When connecting to the interface, you should get the key and partner on the server side, which is equivalent to the user and password. The configuration is completed in the configuration file, for example:
Step 2: encrypt and generate a sign. Generally, encryption is extracted as a method. Note that encryption is performed according to the encryption method specified by the server end, so MD5 or other encryption is performed, follow the rules. For example:
Step 3: splice the url with the & interval between the request parameters. This is too simple and will not be used as an example;
Step 4: Send the HTTP request according to the spliced url and return the response string;
The last step is to process the xml or other data in the response;