1234567891011121314151617181920212223242526272829303132333435 |
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- @Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
- @AUTHOR: ASJRD018
- @NAME: AnsjerFormal
- @software: PyCharm
- @DATE: 2019/4/2 15:17
- @Version: python3.6
- @MODIFY DECORD:ansjer dev
- @file: testttt.py
- @Contact: chanjunkai@163.com
- """
- # -*- coding: utf-8 -*-
- import requests
- url = requests.put('http://cnvod1.oss-cn-shenzhen.aliyuncs.com/wupengyangceshi.png?OSSAccessKeyId=LTAIyMkGfEdogyL9&Expires=1554277819&Signature=4Pum%2Bpl8h4yO4ZcAgCURQJ7FTfQ%3D',data='jla;dksfjlk;asdjfklasdjlkfjdsa;lkfjlka;sdf;lkdsaj')
- print(url.status_code)
- exit()
- import oss2
- # 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
- auth = oss2.Auth('LTAIyMkGfEdogyL9', '71uIjpsqVOmF7DAITRyRuc259jHOjO')
- # Endpoint以杭州为例,其它Region请按实际情况填写。
- bucket = oss2.Bucket(auth, 'oss-cn-shenzhen.aliyuncs.com', 'cnvod1')
- # 设置此签名URL在60秒内有效。
- url = bucket.sign_url('PUT', 'wupengyangceshi.png', 60)
- print(url)
- # import requests
- # r = requests.put(url,data='xadf')
- # print(r.content)
|