The method of HTTP protocol and requests library for the short life

Source: Internet
Author: User

The main method of the Requests library: Requests.request () constructs a request

Requests.get () Gets the main method of the HTML page, which corresponds to the get of the HTTP

Requests.head () method to get the HTML page header, corresponding to the head of the HTTP

Requests.post () submits a POST request to the Web page that corresponds to the post for HTTP

Requests.put () submits a put request to an HTML Web page that corresponds to the put of the HTTP

Requests.patch () submits a local modification request to an HTML Web page that corresponds to the patch for HTTP

Requests.delete () Delete request to HTML page, corresponding to the delete of HTTP

Note: Consistent with HTTP operations

HTTP protocol uses URL as identity for locating network resources
Format: http://host[:p Ort][path]
Host: A legitimate host name or IP address
Port: Port number, default is 80
Path: Paths to request resources
Understand the difference between pstch and put

Here is still to recommend my own built Python development Learning Group: 725479218, the group is the development of Python, if you are learning Python, small series welcome you to join, everyone is the software Development Party, not regularly share dry goods (only Python software development-related), Including a copy of my own. 2018 Latest Python Advanced materials and high-level development tutorials, welcome to the next step and into Python's small partners

Use headers to get header information, while text is empty

  

The method of HTTP protocol and requests library for the short life

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.