From ee5bf4c38891e7d16b643f7b971b775ec508da72 Mon Sep 17 00:00:00 2001 From: test-xy Date: Thu, 22 Aug 2024 14:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20md/demo1.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md/demo1.py | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 md/demo1.py diff --git a/md/demo1.py b/md/demo1.py deleted file mode 100644 index 9cbfcfb..0000000 --- a/md/demo1.py +++ /dev/null @@ -1,39 +0,0 @@ -import base64 -from sys import prefix -import requests - -from urllib.parse import urlparse,unquote, urlunparse - -# # 原始 URL -# url = "http%3A%2F%2F112.95.163.96%3A13095%2Fapi%2Fv1.0%2Fpredictions%3Fserving%3D27e77247-a61d-4c63-8d04-d944912f6ca3&jobName=resnet50v4-5108&mic=FO19ZRWkLDADYKq2%2BzkJxqVj4BM63M99HmcOStCtB34%3D&backend=inference&usertoken=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI3OGVkMWVhMmVhZjE0MWNmOWYyNWNiZjQ2MDdlNDQ2MyIsImF1ZCI6Ijc4ZWQxZWEyZWFmMTQxY2Y5ZjI1Y2JmNDYwN2U0NDYzIiwic2lnbkFwcCI6ImZyb250IiwiaXNzIjoid3d3LmJpdGFodWIuY29tIiwiZXhwIjoxNzIxOTA5MjMwLCJpYXQiOjE3MjE4NzMyMzAsImp0aSI6IjE3MjE5NzMyMzk4MTcifQ.-0Wt05pybFP-RDGwDInKowQbopJXZp6SyWJYF7A8dD" -# # URL 解码 -# decoded_url = urlparse(unquote(url)) -# print(decoded_url) -# url = url.replace("%3A", ":").replace("%2F", "/").replace("%3F", "?").replace("%3D", "=").replace("%26", "&") -# print(url) -# endpoint = "112.95.163.96:13095" -# ori_prefix = f'{decoded_url.scheme}://{decoded_url.netloc}' -# prefix = f'{decoded_url.scheme}://{endpoint}' -# print(f"解码后的 URL: {prefix+url[len(ori_prefix):-1]}") -# dest = prefix+url[len(ori_prefix):-1] - -# URL 再编码,保留安全字符 -# re_encoded_url = urlencode(decoded_url) -# print(f"再编码后的 URL: {re_encoded_url}") - -# # 解码 URL -# parsed_url = urlparse(unquote(url)) - -# print(parsed_url) -# print(f'原始 URL: {url}\n') -# print(f'解码后的路径: {parsed_url.path}\n') -# print(f'quote URL: {quote(new_url)}\n') - -import requests -files = { - "images": ('./cat.jpg', open('./cat.jpg', "rb"), "image/jpeg") -} -response = requests.post("http://localhost:8080/", files=files, verify=False) - -print(response.status_code) -print(response.text)