Add using C#

From @jonmyates on Fri Sep 09 2016 13:02:56 GMT+0000 (UTC)


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

I have the Get working:

var myRequest = WebRequest.CreateHttp("");
            myRequest.Method = "GET";
            myRequest.UserAgent = "WebRequestDemo";

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

But can’t seem to workout the Add.

Thank you.


Copied from original issue:

From @RichardLitt on Sat Sep 10 2016 03:10:00 GMT+0000 (UTC)

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

From @richardschneider on Wed Dec 14 2016 23:41:50 GMT+0000 (UTC)

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.