Serialize parameters into an HTTP request. This method takes user provided parameters and a shape model and serializes the parameters to an HTTP request. More specifically, this method returns information about parts of the HTTP request, it does not enforce a particu
(self, parameters, operation_model)
| 83 | DEFAULT_ENCODING = 'utf-8' |
| 84 | |
| 85 | def serialize_to_request(self, parameters, operation_model): |
| 86 | """Serialize parameters into an HTTP request. |
| 87 | |
| 88 | This method takes user provided parameters and a shape |
| 89 | model and serializes the parameters to an HTTP request. |
| 90 | More specifically, this method returns information about |
| 91 | parts of the HTTP request, it does not enforce a particular |
| 92 | interface or standard for an HTTP request. It instead returns |
| 93 | a dictionary of: |
| 94 | |
| 95 | * 'url_path' |
| 96 | * 'host_prefix' |
| 97 | * 'query_string' |
| 98 | * 'headers' |
| 99 | * 'body' |
| 100 | * 'method' |
| 101 | |
| 102 | It is then up to consumers to decide how to map this to a Request |
| 103 | object of their HTTP library of choice. Below is an example |
| 104 | return value:: |
| 105 | |
| 106 | {'body': {'Action': 'OperationName', |
| 107 | 'Bar': 'val2', |
| 108 | 'Foo': 'val1', |
| 109 | 'Version': '2014-01-01'}, |
| 110 | 'headers': {}, |
| 111 | 'method': 'POST', |
| 112 | 'query_string': '', |
| 113 | 'host_prefix': 'value.', |
| 114 | 'url_path': '/'} |
| 115 | |
| 116 | :param parameters: The dictionary input parameters for the |
| 117 | operation (i.e the user input). |
| 118 | :param operation_model: The OperationModel object that describes |
| 119 | the operation. |
| 120 | """ |
| 121 | raise NotImplementedError("serialize_to_request") |
| 122 | |
| 123 | def _create_default_request(self): |
| 124 | # Creates a boilerplate default request dict that subclasses |
no outgoing calls
no test coverage detected