Click here to Skip to main content
15,887,854 members
Home / Discussions / Web Development
   

Web Development

 
SuggestionRe: Domain registration Pin
Richard Deeming15-Sep-20 22:01
mveRichard Deeming15-Sep-20 22:01 
Questionvisualization of data on a website, where the data is provided by some remote C++ program Pin
Arist0tle11-Sep-20 5:44
Arist0tle11-Sep-20 5:44 
AnswerRe: visualization of data on a website, where the data is provided by some remote C++ program Pin
professor tourneseul17-Mar-21 7:50
professor tourneseul17-Mar-21 7:50 
QuestionKENDO GRID with PAGING, SORTING, FILTERING , CUSTOMIZATION Pin
sagarpallavi9-Sep-20 21:40
sagarpallavi9-Sep-20 21:40 
QuestionHI Everyone Pin
Sarbjit Grewal6-Sep-20 18:20
professionalSarbjit Grewal6-Sep-20 18:20 
AnswerRe: HI Everyone Pin
Sandeep Mewara6-Sep-20 19:03
mveSandeep Mewara6-Sep-20 19:03 
QuestionWordpress to html software, So I can code it freely (live option?) Pin
Dr3am'R6-Sep-20 4:58
Dr3am'R6-Sep-20 4:58 
AnswerRe: Wordpress to html software, So I can code it freely (live option?) Pin
Sandeep Mewara6-Sep-20 19:07
mveSandeep Mewara6-Sep-20 19:07 
QuestionSimple Question on Http Verbs Pin
Kevin Marois31-Aug-20 7:00
professionalKevin Marois31-Aug-20 7:00 
AnswerRe: Simple Question on Http Verbs Pin
Richard Deeming31-Aug-20 22:37
mveRichard Deeming31-Aug-20 22:37 
GeneralRe: Simple Question on Http Verbs Pin
Kevin Marois1-Sep-20 6:01
professionalKevin Marois1-Sep-20 6:01 
GeneralRe: Simple Question on Http Verbs Pin
Richard Deeming1-Sep-20 7:13
mveRichard Deeming1-Sep-20 7:13 
AnswerRe: Simple Question on Http Verbs Pin
F-ES Sitecore1-Sep-20 0:41
professionalF-ES Sitecore1-Sep-20 0:41 
GeneralRe: Simple Question on Http Verbs Pin
Kevin Marois1-Sep-20 5:59
professionalKevin Marois1-Sep-20 5:59 
GeneralRe: Simple Question on Http Verbs Pin
F-ES Sitecore1-Sep-20 6:35
professionalF-ES Sitecore1-Sep-20 6:35 
GeneralRe: Simple Question on Http Verbs Pin
Kevin Marois1-Sep-20 7:10
professionalKevin Marois1-Sep-20 7:10 
GeneralRe: Simple Question on Http Verbs Pin
F-ES Sitecore1-Sep-20 7:25
professionalF-ES Sitecore1-Sep-20 7:25 
GeneralRe: Simple Question on Http Verbs Pin
Kevin Marois1-Sep-20 10:23
professionalKevin Marois1-Sep-20 10:23 
GeneralRe: Simple Question on Http Verbs Pin
F-ES Sitecore1-Sep-20 10:33
professionalF-ES Sitecore1-Sep-20 10:33 
GeneralRe: Simple Question on Http Verbs Pin
Kevin Marois1-Sep-20 11:09
professionalKevin Marois1-Sep-20 11:09 
GeneralRe: Simple Question on Http Verbs Pin
F-ES Sitecore2-Sep-20 0:37
professionalF-ES Sitecore2-Sep-20 0:37 
GeneralRe: Simple Question on Http Verbs Pin
DerekT-P1-Sep-20 11:12
professionalDerekT-P1-Sep-20 11:12 
GeneralRe: Simple Question on Http Verbs Pin
F-ES Sitecore2-Sep-20 0:34
professionalF-ES Sitecore2-Sep-20 0:34 
GeneralRe: Simple Question on Http Verbs Pin
DerekT-P2-Sep-20 3:03
professionalDerekT-P2-Sep-20 3:03 
Kevin said:
public class MyController : ApiController
{
[HttpGet]
public void DoSomething(int id)
    {
        MyBL myBL = new MyBL();
        myBl.DeleteARecord(Id);
    }
}
I've marked the method with [HttpGet], yet called a Delete method on the BL.
"DoSomething" is marked up for HttpGet and he says he's calling it with HttpGet. In his method DoSomething he calls a business layer method myBL.DeleteARecord(Id) but for all we know that is just counting apples.

OR - and this may be the case, I don't do MVC so maybe it's a .Net restriction (as opposed to an HTTP restriction) - will it not allow you to have a void method decorated with HttpGet? (In which case it shouldn't even compile).

There are two parts to an answer to Kevin's question - firstly, why does HTTP need verbs; then secondly, why does ASP.Net need to reference them? From my WebForms / web service background, I've never had to deal with HTTP verbs, other than (in some cases) allowing .ASMX services to be called from a GET request (which was done purely for the benefit of a 3rd party, to make testing simpler for them). Re-reading the original post, I think Kevin's more concerned with why ASP.Net MVC needs the markup, to which the answer is that it's used for mapping the request to the method.
GeneralRe: Simple Question on Http Verbs Pin
F-ES Sitecore2-Sep-20 3:13
professionalF-ES Sitecore2-Sep-20 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.