MCPcopy Create free account
hub / github.com/instantdb/instant / put_binary

Method put_binary

client/packages/python/src/instantdb/_sync/http.py:107–123  ·  view source on GitHub ↗
(
        self,
        path: str,
        *,
        content: Any,  # bytes or an iterator of bytes (streaming body)
        extra_headers: dict[str, str],
        params: dict[str, Any] | None = None,
    )

Source from the content-addressed store, hash-verified

105 return self._request("DELETE", path, params=params)
106
107 def put_binary(
108 self,
109 path: str,
110 *,
111 content: Any, # bytes or an iterator of bytes (streaming body)
112 extra_headers: dict[str, str],
113 params: dict[str, Any] | None = None,
114 ) -> Any:
115 headers = self._headers()
116 # Drop the default JSON content-type; a binary upload supplies its own
117 # via extra_headers, or omits it so the server infers from the path.
118 headers.pop("content-type", None)
119 headers.update(extra_headers)
120 response = self._client.request(
121 "PUT", path, params=params, content=content, headers=headers
122 )
123 return self._handle_response(response)
124
125 def _request(
126 self,

Callers 1

upload_fileMethod · 0.45

Calls 3

_headersMethod · 0.95
_handle_responseMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected