gpt4 book ai didi

asp.net - HttpWebRequest 上 MediaType 属性的有效值是什么

转载 作者:搜寻专家 更新时间:2023-10-31 08:22:20 24 4
gpt4 key购买 nike

HttpWebRequest 的 MediaType 属性的有效值是什么?

我想做这样的事情:

Dim url As String = HttpContext.Current.Request.Url.AbsoluteUri
Dim req As System.Net.HttpWebRequest = DirectCast(System.Net.WebRequest.Create(New Uri(url)), System.Net.HttpWebRequest)
' Add the current authentication cookie to the request
Dim cookie As HttpCookie = HttpContext.Current.Request.Cookies(FormsAuthentication.FormsCookieName)
Dim authenticationCookie As New System.Net.Cookie(FormsAuthentication.FormsCookieName, cookie.Value, cookie.Path, HttpContext.Current.Request.Url.Authority)

req.CookieContainer = New System.Net.CookieContainer()
req.CookieContainer.Add(authenticationCookie)
req.MediaType = "PRINT"

Dim res As System.Net.WebResponse = req.GetResponse()
'Read data
Dim ResponseStream As Stream = res.GetResponseStream()
'Write content into the MemoryStream
Dim resReader As New BinaryReader(ResponseStream)
Dim docStream As New MemoryStream(resReader.ReadBytes(CInt(res.ContentLength)))

谢谢。

最佳答案

我认为这个维基百科页面应该为您提供相当全面的媒体类型列表:
Media Types

关于asp.net - HttpWebRequest 上 MediaType 属性的有效值是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1982229/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com