Rest API invocation Methods and custom APIs for Azure Mobile Services

Source: Internet
Author: User

Azure Mobile Services is a cross-platform mobile app backend service that Microsoft offers in the Azure platform, namely, mobile back-end as a service. Support. NET and JavaScript (node. js) write back-end code, supporting a variety of mainstream front-end platforms, including iOS, Android, Windows, HTML. Provides single sign-on, offline synchronization, access to internal data, push reminders and other functions, but also can be automatically scaled as needed. This makes it very easy to develop a mobile app backend service.

Although Microsoft has provided the SDK for each platform, it is possible to use its rest API directly to manipulate the data on the server side. Adarsha Datta In this article explains how to use the rest API.

After creating an instance of the mobile service and creating a data table, you will get a unique REST API address: Https://<service_name>.azure-mobile.net/tables/<table_ Name> (Domestic is:https://<service_name>.azure-mobile.cn/tables/<table_name>). Then according to the standard Rest API principle, add data is to use post data to this address, query data with get access to this address (support OData standard for filtering operations, etc.), update data is to use patch to submit data to this address (plus "/<item_id > "), delete data is to use Delete to access this address (plus"/<item_id> "), delete support Soft Delete, that is, just tag Delete, this method is particularly useful when dealing with offline and concurrency.

If you feel that these standard HTTP verb access methods for data tables are not enough for you or need to handle more complex business processing on the server side, you can define custom APIs (customized APIs) on the mobile service. In the Mobile Services Control Panel API page, you can add a custom API that accesses the address:https://<service_name>.azure-mobile.net/api/<api_name> (Domestic address is:https://<service_name>.azure-mobile.cn/api/<api_name>). Since we chose JavaScript as the back-end language by default when creating the service, you can write the backend code of the custom API directly in the Azure console. After writing the completed code in node. JS syntax, you can access the custom address through the relevant HTTP verb.

More specific illustrations and code, you can "read the original" to visit, but also recommend that you do. At the beginning of the original, there is a link to the author's other article that explains the contents of the mobile service's. NET SDK.

Read the original: http://blogs.msdn.com/b/cdndevs/archive/2015/04/09/azure-mobile-services-and-apis-restful-and-custom.aspx

Rest API invocation Methods and custom APIs for Azure Mobile Services

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.