Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 310287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:49:10+00:00 2026-05-12T07:49:10+00:00

Unfortunately, I’m doing some work on a (legacy) project that is build with ASP.NET

  • 0

Unfortunately, I’m doing some work on a (legacy) project that is build with ASP.NET Web Forms. I can’t migrate it to ASP.NET MVC (so please don’t suggest that as an answer).

I wish to create an API to expose some of our data. So, I went a head and made a web service. Pretty simple stuff. BUT, for the first few methods, I wish to expose them only as HTTP-GET. For my last method, I wish to expose this only as HTTP-POST.

I’m so used to using ASP.NET MVC, which is why I really love this RESTful way of programming, but I’m not sure how to do this with my web service?

I’m using a URL Rewriter, so that handles the ‘RESTfull’ consuming of the api (it’s lame, but it works).

So, is there a way to block a web service to only accept the HTTP verb?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:49:10+00:00Added an answer on May 12, 2026 at 7:49 am

    Add the following above the method declaration:

    [ScriptMethod(UseHttpGet = false)]
    

    This forces the method to respond only to POST. Set to true if you want the method to respond to GET. The gotcha here is that you need to be using ASP.NET 3.5 or the ASP.NET AJAX Extensions for ASP.NET 2.0. You can read more about this here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

unfortunately Dreamweaver doesn't support Asp.net mvc, and I find it hard to believe that
Unfortunately on a project here at work, someone had the great idea to put
Unfortunately cabal-dev ghci does not work in this project, i get an error: Loading
Unfortunately I don't have access to a *nix box at work or at home.
Unfortunately, the problem is not more specific than that. I've found a few examples
Unfortunately, Google didn't help me much: I'm looking for some information regarding the execution
Unfortunately I've got a bug that I have been working on for 1 full
Unfortunately, for some reason I cannot fathom, I haven't been able to get windbg
Unfortunately, SQL Server can not a handle a parameter list which exceeds 2100 parameters.
Unfortunately, Im having to use radio buttons in a project. I cant get my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.