• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

HttpVerbs

Hi

I am bit confusing with httpverbs in asp.net , if i look in to my project

 the verbs was added in web.config file as follows

<add verbs= * type=... >

as i know * indicates  GET,PUT,HEADER,DELETE,POST... etc i have searched in google

where i have found only the defination for those but i did not get any examples to know

how it will be used and where it will be used because i have the code as follows

in abc.aspx

  under button click event it is calling the  businesslayer the method say GetDetails()

  and now under this Business layer method it is calling  two methods in the datalayer as follows

   DeleteExisingRecords() // it will delete the existing records in database

   AddNewRecords()  // it will Add the New records in to database
 

Now please clarify the following

1) where exactly and what types of verbs are used in the asp.net in my above code

2) if possible  please provide me an example with each of verb where and how it is used.

            many thanks in Advance.
0
praveen1981
Asked:
praveen1981
  • 3
  • 2
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
You do not choose the verb that is used.  If you do a simple page request with or without a query string, it will be a GET.  If you submit a form, it can be a GET or a POST.  POST is required to upload files and POST can upload more data than GET is allowed to.  HEAD just returns info about the page.  http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol  If your ASPX page uses VIEWSTATE, it will always use POST because the whole page is a form with the method="post".

All the rest of the 'verbs' require handlers and permissions on the web server.  Mostly because they are 'dangerous' because they can overwrite and delete files.  WEBDAV, used in FrontPage and some other programs, uses PUT and DELETE but requires a login.  On publicly exposed web servers, unused verbs are normally removed or blocked.
0
 
praveen1981Author Commented:
Thanks for your clarification, but still I am not understand properly, can you  please provide me the code for each method, so that i can understand clearly.
0
 
Dave BaldwinFixer of ProblemsCommented:
You already have the code you need.  GET is to load a new page and POST is to submit a form.  Unless you are doing systems programming, you don't need any of the others.  It is unlikely that you will be allowed to use them in normal web programming.
0
 
praveen1981Author Commented:
Thank you very much..
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now