Skip to content

Commit 3aa993b

Browse files
author
李严
committed
Merge branch 'merge_github' into 'master'
Merge See merge request iaasng/volcengine-python-sdk!233
2 parents 2805799 + 5bf53f0 commit 3aa993b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

FAQ.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,10 @@ configuration.schema = "http" # https or http
5353
configuration.debug = False # 是否开启调试
5454

5555
volcenginesdkcore.Configuration.set_default(configuration)
56-
```
56+
```
57+
58+
### 4. 对象转 Dict
59+
对于请求和响应的对象,可以通过 to_dict() 方法将其转换成 dict 类型
60+
61+
### 5. 查看使用示例
62+
[volcenginesdkexamples](https://github.com/volcengine/volcengine-python-sdk/tree/master/volcenginesdkexamples)

volcenginesdkcore/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def update_params_for_auth(self, host, path, method, headers, querys, auth_setti
558558

559559
for auth in auth_settings:
560560
headers["Host"] = host
561-
if method == "POST":
561+
if method in ["POST", "PUT", "DELETE", "PATCH"]:
562562
body = json.dumps(body)
563563
else:
564564
body = ""
@@ -673,7 +673,7 @@ def __deserialize_model(self, data, klass, service):
673673
isinstance(data, (list, dict))):
674674
value = data[klass.attribute_map[attr]]
675675
kwargs[attr] = self.__deserialize(value, attr_type, service)
676-
676+
# support pass configuration
677677
kwargs['_configuration'] = self.configuration
678678
instance = klass(**kwargs)
679679

volcenginesdkcore/configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
3333
"""
3434

3535
def __init__(self):
36+
"""Constructor"""
37+
3638
# Default Base url
3739
self.host = "open.volcengineapi.com"
3840
# Schema Support http or https

0 commit comments

Comments
 (0)