Make an Android client for the YII architecture website

Source: Internet
Author: User

The site does not have an interface reserved. Creating a client for this type of Web site is a post and get request that simulates a Web page, and then gets the data returned by the server.

1. Use HttpWatch to analyze the contents and URLs of the Get and post requests sent by the browser when doing the client. The main content of the analysis is the analysis of post requests. Post mainly includes headers, cookies, and post data. Need to know the meaning of the parameter key-value pairs in post data, how to set the cookie value in the header and how to get cookies.

2, do not know because of the YII architecture or other reasons, this site can use the session ID to maintain the login status of this reply. That is, after the login verification passed, the next time the request is sent using the newly returned session ID after authentication login to send the request, the server side or is not logged on. So you can only use cookies one way. Using HttpWatch, you can clearly know the cookie name and obtain a cookie from the returned content by using the cookie name.

3. A httpclient can only be used to send a GET or POST request. When sending a GET or POST request, you need to set the cookie portion of the header. The contents of this section are mainly Phpsessid and cookies. The first time you log in to get a cookie, the value of the cookie in the header of this visit is PHPSESSID before the cookie. The cookie value in the header section is changed to a cookie before using the cookie to access the website later, Phpsessid.

Make an Android client for the YII architecture website

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.