Similarities and differences between PHP PSR-7 and python WSGI

Source: Internet
Author: User
Currently in the PHP Slim3 framework, there is a concept of PSR-7, looked at, it seems to be the original PHP global variables to encapsulate a bit, more OOP a little, I have been familiar with Django before and feel like WSGI. I don't know if these two are just one type of things. Currently in the PHP Slim3 framework, there is a concept of PSR-7, looked at, it seems to be the original PHP global variables to encapsulate a bit, more OOP a little, I have been familiar with Django before and feel like WSGI. I don't know if these two are just one type of things.

Reply content:

Currently in the PHP Slim3 framework, there is a concept of PSR-7, looked at, it seems to be the original PHP global variables to encapsulate a bit, more OOP a little, I have been familiar with Django before and feel like WSGI. I don't know if these two are just one type of things.

Let's take a look at the descriptions on the official website.

1. WSGI

WSGI is the Web Server Gateway Interface. It is a specification that describes how a web server communicates with web applications, and how web applications can be chained together to process one request.
WSGI is a Python standard described in detail in PEP 3333.

  1. PSR-7

PSR-7: HTTP message interfaces
This document (HTTP message desribetion) describes common interfaces for representing HTTP messages as described in RFC 7230 and RFC 7231, and URIs for use with HTTP messages as described in RFC 3986.

We should be able to see the difference.

WSGI isWeb Server Gateway Interface, That isServer Gateway InterfaceThis article describes how the Web server communicates with your python cgi program, what do you want to talk about, and what tasks I have on this side. After you have done this, let me know the results, I told the guy in the browser to go.

SoPSR-7What about it? It isPSRA new member of the family, isHTTP message interfaces. This is related to the difference between python and php as web development languages. That is to say,PSR-7A set of standards are defined to standardize the use of PHP for HTTP Communication, replacing the super global variables provided by PHP itself because they are slightly poor.

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.