(json: Any)
| 174 | |
| 175 | |
| 176 | def encode_json(json: Any) -> tuple[dict[str, str], ByteStream]: |
| 177 | body = json_dumps( |
| 178 | json, ensure_ascii=False, separators=(",", ":"), allow_nan=False |
| 179 | ).encode("utf-8") |
| 180 | content_length = str(len(body)) |
| 181 | content_type = "application/json" |
| 182 | headers = {"Content-Length": content_length, "Content-Type": content_type} |
| 183 | return headers, ByteStream(body) |
| 184 | |
| 185 | |
| 186 | def encode_request( |
no test coverage detected