Home Backend Development PHP Tutorial 什么是RESTful?

什么是RESTful?

Jun 06, 2016 pm 04:43 PM
restful

RESTful是一种网络应用程序的设计风格和开发方式,基于HTTP,可以使用XML格式定义或JSON格式定义;RESTful适用于移动互联网厂商作为业务使能接口的场景,实现第三方OTT调用移动网络资源的功能。

什么是RESTful?

什么是RESTful?

RESTFUL是一种网络应用程序的设计风格和开发方式,基于HTTP,可以使用XML格式定义或JSON格式定义。RESTFUL适用于移动互联网厂商作为业务使能接口的场景,实现第三方OTT调用移动网络资源的功能,动作类型为新增、变更、删除所调用资源。

本质:是一种软件架构风格

核心:面向资源设置api

RESTFUL特点包括:

1、每一个URI代表1种资源;

2、客户端使用GET、POST、PUT、DELETE4个表示操作方式的动词对服务端资源进行操作:GET用来获取资源,POST用来新建资源(也可以用于更新资源),PUT用来更新资源,DELETE用来删除资源;

3、通过操作资源的表现形式来操作资源;

4、资源的表现形式是XML或者HTML;

5、客户端与服务端之间的交互在请求之间是无状态的,从客户端到服务端的每个请求都必须包含理解请求所必需的信息。

为什么要使用Restful?

解决问题:降低开发的复杂性;提高系统的可伸缩性

Restful与其他架构有什么区别?

soap webserver 是一种跨编程语言,跨操作平台的远程调用技术。通过http协议发送请求和接收结果时采用xml格式封装,并增加了一些特定的http消息头,这些特定的http消息头和xml内容格式就是soap协议

这俩个架构的区别在:1、效率2、易用性3、安全性

效率和易用性:

soap案例:由于soap添加的是特定的http消息头,如果业务提供方(微信)不提供文档...没有人会使用它的api

安全性:

Restful适用于效率要求很高,但安全性要求不高的场景

soap的成熟性对于安全性要求较高的接口设计带来便利

更多相关知识,请访问 PHP中文网!!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Flask-RESTful and Swagger: Best practices for building RESTful APIs in Python web applications (Part 2) Flask-RESTful and Swagger: Best practices for building RESTful APIs in Python web applications (Part 2) Jun 17, 2023 am 10:39 AM

Flask-RESTful and Swagger: Best Practices for Building RESTful APIs in Python Web Applications (Part 2) In the previous article, we explored the best practices for building RESTful APIs using Flask-RESTful and Swagger. We introduced the basics of the Flask-RESTful framework and showed how to use Swagger to build documentation for a RESTful API. Book

RESTful API development with Laravel: Building modern web services RESTful API development with Laravel: Building modern web services Aug 13, 2023 pm 01:00 PM

RESTful API Development with Laravel: Building Modern Web Services With the rapid development of the Internet, the demand for Web services is increasing day by day. As a modern Web service architecture, RESTfulAPI is lightweight, flexible, and easy to expand, so it has been widely used in Web development. In this article, we will introduce how to use the Laravel framework to build a modern RESTful API. Laravel is a PHP language

Building a RESTful API using Django Building a RESTful API using Django Jun 17, 2023 pm 09:29 PM

Django is a web framework that makes it easy to build RESTful APIs. RESTfulAPI is a web-based architecture that can be accessed through HTTP protocol. In this article, we will introduce how to use Django to build RESTful APIs, including how to use the DjangoREST framework to simplify the development process. Install Django First, we need to install Django locally. You can use pip to install Django, specifically

How to use Python Flask RESTful How to use Python Flask RESTful Apr 29, 2023 pm 07:49 PM

1. Overview of RESTful REST (RepresentationalStateTransfer) style is a resource-oriented Web application design style that follows some design principles to make Web applications have good readability, scalability, and maintainability. Let's explain each aspect of the RESTful style in detail: Resource identifier: In the RESTful style, each resource has a unique identifier, usually a URL (UniformResourceLocator). URLs are used to identify the location of resources so that clients can access them using the HTTP protocol. For example, a simple URL could be: http

Steps to build a RESTful API using PHP Steps to build a RESTful API using PHP Jun 17, 2023 pm 01:01 PM

With the development and popularity of the Internet, web applications and mobile applications are becoming more and more common. These applications need to communicate with the backend server and get or submit data. In the past, the conventional way to communicate was to use SOAP (Simple Object Access Protocol) or XML-RPC (XML Remote Procedure Call). Over time, however, these protocols were deemed too cumbersome and complex. Modern applications require more lightweight and straightforward APIs to communicate. RESTfulAPI (presentation layer state conversion AP

Best practices for developing RESTful services with Beego Best practices for developing RESTful services with Beego Jun 23, 2023 am 11:04 AM

In the current environment of continuous innovation in information technology, RESTful architecture is popular in various commonly used WebAPI applications and has become an emerging service development trend. The Beego framework, as a high-performance and easily scalable Web framework in Golang, is widely used in the development of RESTful services due to its advantages of efficiency, ease of use, and flexibility. The following will provide some reference for developers from the perspective of best practices for developing RESTful services in Beego. 1. Routing design in REST

RESTful API design and implementation method RESTful API design and implementation method Jun 22, 2023 pm 04:07 PM

RESTfulAPI is a commonly used API design style in the current Web architecture. Its design concept is based on the standard method of the HTTP protocol to complete the representation and interaction of Web resources. During the implementation process, RESTful API follows a series of rules and constraints, including cacheability, server-client separation, statelessness, etc. These rules ensure the maintainability, scalability, security and ease of use of the API. Next, this article will introduce in detail the design and implementation of RESTfulAPI

How to develop a RESTful-based API using Java How to develop a RESTful-based API using Java Sep 21, 2023 pm 03:53 PM

How to use Java to develop a RESTful-based API. RESTful is an architectural style based on the HTTP protocol. It uses the GET, POST, PUT, DELETE and other methods of the HTTP protocol to operate resources. In Java development, some frameworks can be used to simplify the development process of RESTful API, such as SpringMVC, Jersey, etc. This article will introduce you in detail how to use Java to develop a RESTful-based

See all articles