You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support callback options for put and multipartUpload (#379)
* test: support callback server
* test: change test name
* test: add browser callback case
* feat: add case callbackServer doc
* fix: multipartUpload and multipartUploadCopy callback
* feat: support callback and callbackVar options to put and multipartUpload
* feat: review code fix
* feat: modify callback readme
Close#85
Copy file name to clipboardExpand all lines: README.md
+40-54Lines changed: 40 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -793,29 +793,21 @@ parameters:
793
793
-[mime] {String} custom mime, will send with `Content-Type` entity header
794
794
-[meta] {Object} user meta, will send with `x-oss-meta-` prefix string
795
795
e.g.: `{ uid: 123, pid: 110 }`
796
+
-[callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
797
+
- url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL.
798
+
-[host] {String} The host header value for initiating callback requests.
799
+
- body {String} The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var).
800
+
-[contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value.
801
+
-[customValue] {Object} Custom parameters are a map of key-values<br>
802
+
e.g.:
803
+
```js
804
+
var customValue = {var1:'value1', var2:'value2'}
805
+
```
796
806
- [headers] {Object} extra headers, detail see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)
797
807
-'Cache-Control' cache control for download, e.g.:`Cache-Control: public, no-cache`
798
808
-'Content-Disposition' object name for download, e.g.:`Content-Disposition: somename`
799
809
-'Content-Encoding' object content encoding for download, e.g.:`Content-Encoding: gzip`
800
810
-'Expires' expires time (milliseconds) for download, e.g.:`Expires: 3600000`
801
-
-[x-oss-callback] The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
- [x-oss-callback-var] Custom parameters are a map of key-values. You can configure the required parameters to the map. When initiating a POST callback request, the OSS puts these parameters and the system parameters described in the preceding section in the body of the POST request, so that these parameters can be easily obtained by the callback recipient.detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm) Custom parameters<br>
812
-
e.g.: need to use Base64 to encode
813
-
```json
814
-
{
815
-
"x:var1":"value1",
816
-
"x:var2":"value2"
817
-
}
818
-
```
819
811
820
812
Success will return the object information.
821
813
@@ -921,6 +913,16 @@ parameters:
921
913
- [mime] {String} custom mime, will send with`Content-Type` entity header
922
914
- [meta] {Object} user meta, will send with`x-oss-meta-` prefix string
923
915
e.g.:`{ uid: 123, pid: 110 }`
916
+
- [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
917
+
- url {String} After a file is uploaded successfully, the OSS sends a callback request to thisURL.
918
+
- [host] {String} The host header value for initiating callback requests.
919
+
- body {String} The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var).
920
+
- [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value.
921
+
- [customValue] {Object} Custom parameters are a map of key-values<br>
922
+
e.g.:
923
+
```js
924
+
var customValue = {var1: 'value1', var2: 'value2'}
925
+
```
924
926
- [headers] {Object} extra headers, detail see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)
925
927
-'Cache-Control' cache control for download, e.g.:`Cache-Control: public, no-cache`
926
928
-'Content-Disposition' object name for download, e.g.:`Content-Disposition: somename`
-[headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)
1713
-
-[x-oss-callback] The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
-[x-oss-callback-var] Custom parameters are a map of key-values. You can configure the required parameters to the map. When initiating a POST callback request, the OSS puts these parameters and the system parameters described in the preceding section in the body of the POST request, so that these parameters can be easily obtained by the callback recipient.detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm) Custom parameters<br>
1724
-
e.g.: need to use Base64 to encode
1725
-
```json
1726
-
{
1727
-
"x:var1":"value1",
1728
-
"x:var2":"value2"
1729
-
}
1714
+
- [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
1715
+
- url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL.
1716
+
- [host] {String} The host header value for initiating callback requests.
1717
+
- body {String} The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var).
1718
+
- [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value.
1719
+
- [customValue] {Object} Custom parameters are a map of key-values<br>
1720
+
e.g.:
1721
+
```js
1722
+
var customValue = {var1: 'value1', var2: 'value2'}
1730
1723
```
1724
+
- [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)
1731
1725
1732
1726
1733
1727
Success will return:
@@ -1794,30 +1788,22 @@ parameters:
1794
1788
otherwise a new multipart upload will be created.
1795
1789
- [meta] {Object} user meta, will send with `x-oss-meta-` prefix string
1796
1790
- [mime] {String} custom mime , will send with `Content-Type` entity header
1791
+
- [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
1792
+
- url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL.
1793
+
- [host] {String} The host header value for initiating callback requests.
1794
+
- body {String} The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var).
1795
+
- [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value.
1796
+
- [customValue] {Object} Custom parameters are a map of key-values<br>
1797
+
e.g.:
1798
+
```js
1799
+
var customValue = {var1: 'value1', var2: 'value2'}
1800
+
```
1797
1801
- [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)
1798
1802
- 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache`
1799
1803
- 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename`
1800
1804
- 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip`
1801
1805
- 'Expires' expires time (milliseconds) for download, e.g.: `Expires: 3600000`
1802
1806
- **NOTE**: Some headers are [disabled in browser][disabled-browser-headers]
1803
-
-[x-oss-callback] The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>
- [x-oss-callback-var] Custom parameters are a map of key-values. You can configure the required parameters to the map. When initiating a POST callback request, the OSS puts these parameters and the system parameters described in the preceding section in the body of the POST request, so that these parameters can be easily obtained by the callback recipient.detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm) Custom parameters<br>
1814
-
e.g.: need to use Base64 to encode
1815
-
```json
1816
-
{
1817
-
"x:var1":"value1",
1818
-
"x:var2":"value2"
1819
-
}
1820
-
```
1821
1807
- [timeout] {Number} Milliseconds before a request is considered to be timed out
0 commit comments