Skip to content

Commit d7ab44c

Browse files
authored
Merge pull request KscSDK#2 from wcg49802693/master
query_string 绑定Action、Version,绑定到headers中
2 parents 16f9b86 + 1aa0dd2 commit d7ab44c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

kscore/serialize.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,14 @@ def serialize_to_request(self, parameters, operation_model):
188188
self.DEFAULT_METHOD)
189189
# The query serializer only deals with body params so
190190
# that's what we hand off the _serialize_* methods.
191+
serialized['headers'].update(
192+
{
193+
'Action': operation_model.name,
194+
'Version': operation_model.metadata['apiVersion'],
195+
}
196+
)
197+
body_params = {}
191198

192-
body_params = self.MAP_TYPE()
193-
body_params['Action'] = operation_model.name
194-
body_params['Version'] = operation_model.metadata['apiVersion']
195199
if shape is not None:
196200
self._serialize(body_params, parameters, shape)
197201
else:
@@ -358,15 +362,14 @@ def serialize_to_request(self, parameters, operation_model):
358362
serialized['method'] = operation_model.http.get('method',
359363
self.DEFAULT_METHOD)
360364

361-
serialized['query_string'] = self.MAP_TYPE(
362-
Action=operation_model.name, Version=operation_model.metadata['apiVersion']
363-
)
365+
serialized['query_string'] = self.MAP_TYPE()
364366

365367
serialized['headers'] = {
366368
'X-Amz-Target': target,
367369
'Content-Type': 'application/json',
368370
'Accept': 'application/json',
369-
371+
'Action': operation_model.name,
372+
'Version': operation_model.metadata['apiVersion']
370373
}
371374
body = {}
372375
input_shape = operation_model.input_shape

0 commit comments

Comments
 (0)