diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-06-15 13:02:21 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-06-15 13:02:21 +0200 |
commit | 0396a65904a16fbb9820155c2564bb664f516d67 (patch) | |
tree | c1deb4d9759f825282fb3632a7156b437240edd5 | |
parent | 55902e98d868dcce047863859caf596a629d10ec (diff) |
Implement /dag/put routemake-dag-put-impl
-rw-r--r-- | ipfs-api/src/client.rs | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/ipfs-api/src/client.rs b/ipfs-api/src/client.rs index 6c1e3bf..10afc6e 100644 --- a/ipfs-api/src/client.rs +++ b/ipfs-api/src/client.rs @@ -942,22 +942,19 @@ impl IpfsClient { self.request(&request::DagGet { path }, None) } - // TODO /dag routes are experimental, and there isn't a whole lot of - // documentation available for how this route works. - // - // /// Add a DAG node to Ipfs. - // /// - // #[inline] - // pub fn dag_put<R>(&self, data: R) -> AsyncResponse<response::DagPutResponse> - // where - // R: 'static + Read + Send, - // { - // let mut form = multipart::Form::default(); - // - // form.add_reader("arg", data); - // - // self.request(&request::DagPut, Some(form)) - // } + /// Add a DAG node to Ipfs. + /// + #[inline] + pub fn dag_put<R>(&self, data: R) -> AsyncResponse<response::DagPutResponse> + where + R: 'static + Read + Send, + { + let mut form = multipart::Form::default(); + + form.add_reader("arg", data); + + self.request(&request::DagPut, Some(form)) + } // TODO /dag/resolve |