One,. NET API
The General page is an. aspx file, because the. aspx file is formatted with HTML, we pass data in JSON format, so the HTML page format has an effect on the JSON format, so we don't write web-api to use. aspx pages. Instead, use the General application window interface:. ashx file.
Second, the request method:
In general, our. NET-side response requests are the same as the Android side, with 2 different ways: Get/post,
Get request, received information such as: aaa.aspx?id=123&xx=88&yy=99, through the background Aaa.aspx.cs response request. It exposes information.
Post request, the way the page responds: For example, the response in our <from></from> page. No back-exposure information
Third, the API specific format example
Create a new. ashx file, such as:
Figure 1: To ignore the difference between get/post, directly get the value of the ID (not recommended!!! );
Figure 2: Indicates the post page gets the request, gets the value of the ID;
Figure 3: Represents the Get GET request, gets the value of the ID;
Figure 4: Indicates the response processing after the acquisition, including database query, JSON inverse parsing and so on;
Figure 5: Indicates that the background processing is good after the content to return;
Figure 6: Represents the format returned by the background as a JSON data string.
Iv. contents of the Andoriod end:
The andriod side only needs to be connected via HTTP, and then the data obtained by JSON parsing can be used with the relevant features.
Data interaction for Android and. NET APIs