From ae81a4a73a4bc013b135097705fb2fac3f0698b9 Mon Sep 17 00:00:00 2001 From: pengtao Date: Tue, 15 Oct 2019 14:09:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=95=B0=E8=99=9A=E6=8B=9F=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E8=A1=A8=E5=AF=BC=E5=85=A5=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ops/ss_virtual_create.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ops/ss_virtual_create.py b/ops/ss_virtual_create.py index 018fe0f..830b5e7 100644 --- a/ops/ss_virtual_create.py +++ b/ops/ss_virtual_create.py @@ -32,13 +32,15 @@ class SS_Virtual_command: body = {"projectId": projectId, "createParam": createParam, "loginName": loginName, "password": password} quote_body = my_quote(body) - r = requests.post(url=self.ss_virtual_url, header="Accept: application/json", files=filename, data=quote_body) - if r.status_code == requests.codes.ok: - print(f"upload success,return={r.content}") - return True - else: - print(f"upload failed,return={r.content}") - return False + cmd = f"curl --header 'Accept: application/json' --form 'file=@{filename} {self.ss_virtual_url}?{quote_body}" + print(cmd) + # r = requests.post(url=self.ss_virtual_url, header="Accept: application/json", files=filename, data=quote_body) + # if r.status_code == requests.codes.ok: + # print(f"upload success,return={r.content}") + # return True + # else: + # print(f"upload failed,return={r.content}") + # return False def main():