引言
在最近的测试工作中,接触到了S3,我们需要在S3上上传,下载文件从而对文件的数据进行验证,自己也踩了很多坑,查阅了很多文档,接下来把源码分享给大家,一定可用。
from boto3.session import Session
from botocore.exceptions import ClientError
class Test_demo():
def __init__(self):
access_key = "xxxxxxxxxxx"
secret_key = "xxxxxxxxx"
url = "http://172.xx.xx.xxx" # 也可以是自己节点的地址
session = Session(access_key, secret_key