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

  • Home
  • SEARCH
  • 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 8428519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:04:48+00:00 2026-06-10T05:04:48+00:00

When using ServiceStack to create a REST service, how do you handle arbitrary HTTP

  • 0

When using ServiceStack to create a REST service, how do you handle arbitrary HTTP verbs?

The most common verbs have very simple methods. For example, to handle a GET request I would do the following:

public class MyService : RestServiceBase<MyRequest>
{
    public override object OnGet(MyRequest request){
        //do stuff and return HttpResult or object for serialization
    }
}

Similar overrides exist for PUT, POST, DELETE, and PATCH.

What do I do if I want to use HEAD or some other verb?

(I’ve looked through the documentation and examples and other ServiceStack questions but haven’t found anything that indicates the correct way to do this.)

  • 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-06-10T05:04:49+00:00Added an answer on June 10, 2026 at 5:04 am

    ServiceStack’s RestServiceBase class already has built-in support for GET, POST, PUSH, DELETE and PATCH. so you just override it as you would your OnGet() method, e.g. you can handle DELETE requests with:

    public override object OnDelete(MyRequest request){
        //do stuff and return HttpResult or object for serialization
    }
    

    For HEAD requests you currently can’t handle this in a ServiceStack service so you will need to handle it in either a RequestFilter or RequestFitler Attribute (make sure you close the httpRes to terminate the request).

    You also have the opportunity to by-pass the ServiceStack pipeline completely by registering your own Custom IHttpHandler in the EndpointHostConfig.RawHttpHandlers config in your AppHost.

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

Sidebar

Related Questions

I have constructed a simple Rest service using ServiceStack (which is brilliant), that returns
have created REST service using servicestack and in post request I have return object
I am using ServiceStack to create a service which accepts request from and HTML
I'm trying to create a simple event store using C# and [ServiceStack] Redis. public
I have some issue regarding REST API which i have built using servicestack. End
I develop a Rest Service by using ServiceStack. My model contains a DateTime property
I have a super-simple ServiceStack webservice configured using the latest Nuget package (3.8.3 I
Using android 2.3.3, I have a background Service which has a socket connection. There's
ServiceStack marks rest paths for web services using c# attributes. For example [RestService(/hello1)] [RestService(/hello2)]
I am in a restful service environment and we are using ServiceStack as our

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.