Android-How to Use PHP to develop APIs for other clients to call?

Source: Internet
Author: User
You need to develop an android client for a CMS website. How do I write interfaces for Android clients to call? You need to develop an android client for a CMS website. How do I write interfaces for Android clients to call?

Reply content:

You need to develop an android client for a CMS website. How do I write interfaces for Android clients to call?

Interface development, now the popular method is RESTful Architecture
After establishing the development interface standards, follow the relevant development standards.

Refer to the document to understand the RESTful Architecture

You can use the RESTFUL framework to develop separate api interfaces.
Laravel, which supports the restfull framework, is easy to use.
Official Website http://laravel.com

A Rest with an OAuth authorization, the general framework can do, Laravel Yii2

You can use web service.

Write your own webservice. Simply put, the GET method gets data and returns json data to the client. POST, you write a post interface, receive the data to verify if it is legal, and then store the data into the database, return the json

{"ErrorCode": 0, "result": {"key": "value", "key": "value" }}// success {"errorCode": 123, "result": "error code"} // Error

As long as you send and return data, you need to agree with the client, basically what is the problem. If you are afraid of using it by others, the basic security method is to add a key md5 to the parameter for verification.

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.