Python Interface automation test four: code to send HTTPS requests

Source: Internet
Author: User

HTTPS:

Get

url = ' HTTPS://WWW.JUHE.CN/DOCS/API/ID/39 '

r = Requests.get (URL) #发送get请求

Print (R.status_code) #打印状态码

Print (r.headers) #打印返回的报头 (head)

Print (R.text) #查看返回结果的文本形式 (body part)

Sslerror: Certificate Issue:

Method 1: Check if the Faddler is closed and the access is successful when

Method 2: The request parameter is followed by the Verify=false

Verify defaults to True, at which time the certificate is validated and false will not validate the certificate

have a Body section:

content-type:application/x-www-form-urlencoded; Charset=utf-8: Data transfer

Content-type:application/json: Transmitting JSON

Python Interface automation test four: code to send HTTPS requests

Related Article

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.