Joke Collection Website - Blessing messages - How to get the api interface of the website?

How to get the api interface of the website?

Obtaining and calling website API interface is common in website development, and it is also a necessary skill for every programmer and developer. For example, developers often encounter interface calls provided by large websites such as Tencent and Sina. Therefore, as a developer, you should learn how to call API interface while writing good code. This experience demonstrates the API interface call for sending short messages in C# language.

Tools/raw materials

computer

Methods/steps

1, familiar with the concept of API, that is, application programming interface, that is, functions defined in advance during website development, that is, open source functions, but these functions encapsulate some fixed programs and can be called with only one excuse, which is convenient and simple. Just like calling Jquery function.

2, get the interface address to send SMS API interface can be found in the open source code, you can directly go to the open source website to query.

3. Analysis parameters SMS interface is different from other interfaces, and SMS interface can only be opened by local operators. Therefore, the success of interface return does not mean the success of reception, and the specific reception status can only be queried by the operator. In addition, the short message api interface itself does not limit the sending frequency, and the specific sending frequency needs to be set by the user.

4. Call the return value test, write the calling interface in the html file, and test whether the result is called, as shown in the figure, showing the result and failed return parameters.

5.C# Access Interface Enter the following code in the C# program to call the SMS interface; Use the system; Use the system. Assemble. Generics; Use the system. Linq uses the system. Text; usingSystem.Net; Use the system. Io; usingXfrog.Net; Use the system. Diagnosis; Use the system. The Web is as shown in the figure (without demonstrating the creation of C# programs)

6. Declare that every function in the calling space needs to be declared in advance before it can be called. Therefore, at the beginning of the program, the namespace namespace namespace {} must be declared.

7. Defining the calling methods of the request method program are generally Post and Get, so it is necessary to explain what to call, and the difference between Post and Get is not emphasized here.

8. After the request mode is declared by the request function, the request function can be created, including parameters such as sending language and delayed response.

9. After setting the request parameters and related parameters of text conversion, convert the program code into text code, so that the receiver can display the text normally, otherwise it is a piece of code that outsiders can't understand, so the data stream must be converted into a text object.

10. When releasing resources and testing the writer's call, no matter what program it is, it must be released after the call, otherwise it will always occupy resources and consume memory.