Upload files with HTTPWebrequest (multipart/form-data)

后端 未结 21 2485
独厮守ぢ
独厮守ぢ 2020-11-21 04:53

Is there any class, library or some piece of code which will help me to upload files with HTTPWebrequest?

Edit 2:

I do not

21条回答
  •  死守一世寂寞
    2020-11-21 05:22

    Check out the MyToolkit library:

    var request = new HttpPostRequest("http://www.server.com");
    request.Data.Add("name", "value"); // POST data
    request.Files.Add(new HttpPostFile("name", "file.jpg", "path/to/file.jpg")); 
    
    await Http.PostAsync(request, OnRequestFinished);
    

    http://mytoolkit.codeplex.com/wikipage?title=Http

提交回复
热议问题