Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement Zen Tao and submit bug by Python

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how Python implements Zen submission bug". The explanation in the article is simple, clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how Python implements Zen submission bug".

The code is as follows:

Import requestsloginhost= "http://zen.beta.cn/index.php?m=user&f=login" # Login urladd_bughost=" http://zen.beta.cn/index.php?m=bug&f=create&productID=10&branch=0&extra=moduleID=0" # new bug url

Def add_bug (): header= {'Content-Type': "application/x-www-form-urlencoded; charset=utf-8"} # set the request header datas= {"account": "$admin", "password": "123456"} # define the requested data s=requests.session () # instantiate a session object response=s.post (loginhost,headers=header,data=datas) # initiate the request using session

Print (response.content)

Data = {"product": "10", # int belongs * required "openedBuild": "master", # int | trunk impact version * required "branch": "2", # int branch / platform "module": "434", # int module "project": "84", # int project "assignedTo": "baoyi" # string assigned to "deadline": "2020-07-28", # date cut-off date format: YY-mm-dd For example, 2019-01-01 "type": "codeerror", # bug type "bugPhase": "live", # bug found "severity": "3", # int severity value range: 1 | 2 | 4 "pri": "3", # int priority value range: 0 | 1 | 2 | 3 | 4 "keywords": ", # string keyword" title ":" feedback " # title "story": 1143, # requirements "steps": "set bug link in here" # string reproduction step} responses=s.post (add_bughost,headers=header,data=data) print (responses.content.decode ("utf-8"))

If _ _ name__ = ='_ _ main__': add_bug ()

To put it simply, the session session object of the requests library can maintain certain parameters across requests, in other words, for example, if you successfully log in to a website using session, other pages of the site will default to the parameters such as cookie used before the session is requested by using the session object again.

The effect after running the code is as follows:

Thank you for your reading. the above is the content of "how to implement Zen Road submission bug in Python". After the study of this article, I believe you have a deeper understanding of how Python implements Zen Tao submission bug, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report