如何提交从C#中的多部分/格式数据HTTP POST请求

问题描述:

什么是提交与C#中的multipart / form-data的内容类型HTTP POST请求的最简单的方法?必须有一个比建设我自己的要求更好的办法。

What is the easiest way to submit an HTTP POST request with a multipart/form-data content type from C#? There has to be a better way than building my own request.

我问的原因是为了使用此API照片上传到Flickr的:

The reason I'm asking is to upload photos to Flickr using this api:

http://www.flickr.com/services/api/upload.api.html

首先,没有什么错用纯手工执行使用.NET框架的HTTP命令。请记住,这是一个框架,它应该是pretty的通用。

First of all, there's nothing wrong with pure manual implementation of the HTTP commands using the .Net framework. Do keep in mind that it's a framework, and it is supposed to be pretty generic.

其次,我觉得你可以尝试搜索在.net浏览器中实现。我看到这个,也许它涵盖了问题你问一下。或者你也可以搜索 C#HTTP PUT得到交申请。之一的结果导致的非*库可能有益的(奇尔卡特 HTTP)

Secondly, I think you can try searching for a browser implementation in .Net. I saw this one, perhaps it covers the issue you asked about. Or you can just search for "C# http put get post request". One of the results leads to a non-free library that may be helpful (Chilkat Http)

如果你碰巧写你自己的HTTP命令的框架上的.Net之上 - 我想我们都可以享受它,如果你分享: - )

If you happen to write your own framework of HTTP commands on top of .Net - I think we can all enjoy it if you share it :-)