说完了SOAP协议的接口自动化

该说下http协议的接口测试了

HttpService.py

import requests
import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )



class HttpService():
    def __init__(self,host,url):
        self.host=host
        self.url=url

    def httpReq(self,params,method="POST"):
        requesturl=self.host+self.url
        if(method == "POST"):
            resp_data=requests.post(requesturl,params)
        else:
            resp_data=requests.get(requesturl)
        resp=resp_data.text
        return resp
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-08-01
  • 2021-09-13
  • 2021-05-25
相关资源
相似解决方案