MCPcopy
hub / github.com/httpie/cli / from_raw_data

Method from_raw_data

tests/utils/__init__.py:219–227  ·  view source on GitHub ↗
(self, data: Union[str, bytes])

Source from the content-addressed store, hash-verified

217
218 @classmethod
219 def from_raw_data(self, data: Union[str, bytes]) -> 'BaseCLIResponse':
220 if isinstance(data, bytes):
221 with suppress(UnicodeDecodeError):
222 data = data.decode()
223
224 if isinstance(data, bytes):
225 return BytesCLIResponse(data)
226 else:
227 return StrCLIResponse(data)
228
229
230class BytesCLIResponse(bytes, BaseCLIResponse):

Callers 2

httpieFunction · 0.80
httpFunction · 0.80

Calls 3

BytesCLIResponseClass · 0.85
StrCLIResponseClass · 0.85
decodeMethod · 0.80

Tested by

no test coverage detected