HttpWebRequest 这句话的意思

来源:百度知道 编辑:UC知道 时间:2024/09/23 04:53:20
HttpWebRequest1.ContentType = "application/x-www-form-urlencoded";
这是做什么的有什么用?

告诉虚拟机类型是 "application/x-www-form-urlencoded";

HttpWebRequest..::.ContentType 属性
获取或设置 Content-typeHTTP 标头的值。

默认值为 null 引用(在 Visual Basic 中为 Nothing)。

备注
ContentType 属性包含请求的媒体类型。当请求发送 Content-typeHTTP 标头时,赋给 ContentType 属性的值替换任何现有内容。

若要清除 Content-type HTTP 标头,请将 ContentType 属性设置为 nullNothingnullptrnull 引用(在 Visual Basic 中为 Nothing)。