MCPcopy Create free account
hub / github.com/EdupageAPI/edupage-api / encode_request_body

Method encode_request_body

edupage_api/compression.py:171–186  ·  view source on GitHub ↗
(request_data: Union[dict, str])

Source from the content-addressed store, hash-verified

169
170 @staticmethod
171 def encode_request_body(request_data: Union[dict, str]) -> str:
172 encoded_data = (
173 ModuleHelper.encode_form_data(request_data)
174 if type(request_data) == dict
175 else request_data
176 )
177 encoded_data = RequestData.__encode_data(encoded_data)
178 data_hash = sha1(encoded_data.encode()).hexdigest()
179
180 return ModuleHelper.encode_form_data(
181 {
182 "eqap": f"dz:{encoded_data}",
183 "eqacs": data_hash,
184 "eqaz": "1", # use "encryption"? (compression)
185 }
186 )
187
188 @staticmethod
189 def decode_response(response: str) -> str:

Callers 1

send_messageMethod · 0.80

Calls 2

__encode_dataMethod · 0.80
encode_form_dataMethod · 0.45

Tested by

no test coverage detected