summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-06-15 13:02:21 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-06-15 13:02:21 +0200
commit0396a65904a16fbb9820155c2564bb664f516d67 (patch)
treec1deb4d9759f825282fb3632a7156b437240edd5
parent55902e98d868dcce047863859caf596a629d10ec (diff)
downloadrust-ipfs-api-make-dag-put-impl.tar.gz
rust-ipfs-api-make-dag-put-impl.tar.xz
Implement /dag/put routemake-dag-put-impl
-rw-r--r--ipfs-api/src/client.rs29
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