MCPcopy Create free account
hub / github.com/aws/aws-cli / _serialize_headers

Method _serialize_headers

awscli/botocore/serialize.py:1207–1221  ·  view source on GitHub ↗
(self, serialized, operation_model)

Source from the content-addressed store, hash-verified

1205 return bytes(body)
1206
1207 def _serialize_headers(self, serialized, operation_model):
1208 serialized['headers']['smithy-protocol'] = 'rpc-v2-cbor'
1209
1210 if operation_model.has_event_stream_output:
1211 header_val = 'application/vnd.amazon.eventstream'
1212 else:
1213 header_val = 'application/cbor'
1214 self._handle_query_compatible_trait(operation_model, serialized)
1215
1216 has_body = serialized['body'] != b''
1217 has_content_type = has_header('Content-Type', serialized['headers'])
1218
1219 serialized['headers']['Accept'] = header_val
1220 if not has_content_type and has_body:
1221 serialized['headers']['Content-Type'] = header_val
1222
1223
1224SERIALIZERS = {

Callers

nothing calls this directly

Calls 2

has_headerFunction · 0.90

Tested by

no test coverage detected