我正在使用该suds软件包从一个网站发出API请求.我写了一个功能,打开了client网站并提出请求.
我想知道我应该如何或在功能结束时如何终止连接?
我想知道是否会client像MySQLDb.connect实际打开许多单独的API连接,每次调用此函数时都不会关闭.
from suds.client import Client
import sys, re
def querysearch(reqPartNumber, reqMfg, lock):
try:
client = Client('http://app....')
userInfo = {'id':.., 'password':...}
apiResponse = client.service.getParts(...)
...
print apiResponse
except:
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1762 次 |
| 最近记录: |