Skip to content
This repository has been archived by the owner. It is now read-only.

Add using C# #178

Closed
jonmyates opened this issue Sep 9, 2016 · 3 comments
Closed

Add using C# #178

jonmyates opened this issue Sep 9, 2016 · 3 comments

Comments

@jonmyates
Copy link

jonmyates commented Sep 9, 2016

Hello,

Would anyone please be able to advise how to add a file using C#?

I have the Get working:

var myRequest = WebRequest.CreateHttp("http://127.0.0.1:5001/api/v0/object/get?arg=QmNkxQz8JzmK6Y2VUdJ8K8gVx2jrhhzLc7ESsfjnKw8coK");
            myRequest.Method = "GET";
            myRequest.UserAgent = "WebRequestDemo";

            using (var theResponse = myRequest.GetResponse())
            {
                var dataStream = theResponse.GetResponseStream();
                StreamReader reader = new StreamReader(dataStream);
                object objResponse = reader.ReadToEnd();
                dataStream.Close();
                theResponse.Close();
            }

But can't seem to workout the Add.

Thank you.

J

@RichardLitt
Copy link
Contributor

RichardLitt commented Sep 10, 2016

I'm not sure. This may belong in ipfs/support.

@richardschneider
Copy link

richardschneider commented Dec 14, 2016

You must POST a multipart/form-data to the IPFS server.

Here's an example using HttpClient. Feel free to either copy the code or use the Ipfs.Api.

@madavieb
Copy link

madavieb commented May 23, 2017

This issue has been moved to https://discuss.ipfs.io/t/add-using-c/266.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants