Less known important functionality of Request Object
Posted on 1/30/2008 5:22:22 AM
in #ASP.NET 2.X
Hi,/SPAN>/P>
Today I was discussing with my friends about some of the cool stuff available in the request class but rarely used or talked. After the talk I discussed on posting them in the blog./P>
The first in the list is the Request.AcceptTypes. The property returns an array of all the mime types supported by the browser. The results were interesting for me. The number of mime type supported by IE7 are far more than Firefox. The extra mime types included in IE are image//gif, image//x-xbitmap, image//jpeg, image//pjpeg, application//x-ms-application, application//vnd.ms-powerpoint, application//vnd.ms-excel, application//msword. This means that IE can easily recognize these file types and open them in correct application./P>
Request.IsLocal property in the Request (httpRequest) object is used to know if the request is made locally or not. This can be very helpful and allow us to write code that needs to run only locally./SPAN>/P>
/o:p>/SPAN>/P>
Request.IsSecureConnection is used to know if the http connection object is using secure socket or not. This can be useful if you want to ensure that no nonsecure connection is allowed in the page.
/SPAN>/P>
Request.SaveAs() method can be used to save the request (including the header [is configurable in the paratemeter]) in the disk./SPAN>/P>
/o:p>/SPAN>/P>
Request.TotalBytes property is used to know the size of the total bytes in the request./SPAN>/P>
/o:p>/SPAN>/P>
Vikram/SPAN>/P>
|