Skip to content

Update object_post.py #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/object_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def build_signature(access_key_secret, encode_policy):
signature = base64.encodestring(h.digest()).strip()
return signature

def bulid_callback(cb_url, cb_body, cb_body_type=None, cb_host=None):
def build_callback(cb_url, cb_body, cb_body_type=None, cb_host=None):
"""生成callback字符串
:param str cb_url: 回调服务器地址,文件上传成功后OSS向此url发送回调请求
:param str cb_body: 发起回调请求的Content-Type,默认application/x-www-form-urlencoded
Expand Down Expand Up @@ -170,7 +170,7 @@ def build_post_headers(body_len, boundary, headers=None):
# 用户自定义meta
field_dict['x-oss-meta-uuid'] = 'uuid-xxx'
# callback,没有回调需求不填该域
field_dict['callback'] = bulid_callback('http://oss-demo.aliyuncs.com:23450',
field_dict['callback'] = build_callback('http://oss-demo.aliyuncs.com:23450',
'filename=${object}&size=${size}&mimeType=${mimeType}',
'application/x-www-form-urlencoded')
# callback中的自定义变量,没有回调不填该域
Expand Down