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 108939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:59:27+00:00 2026-05-11T01:59:27+00:00

For a POST method, the W3 specs say: If a resource has been created

  • 0

For a POST method, the W3 specs say:

If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header (see Section 10.4).

http://www.ietf.org/internet-drafts/draft-ietf-httpbis-p2-semantics-05.txt (section 8.5)

The standard response actually seems to be to send a Redirect to the newly created resource.

I’m building my site with ASP.NET MVC, and tried to follow the spec, so created a ResourceCreatedResult class:

public class ResourceCreatedResult : ActionResult {     public string Location { get; set; }     public override void ExecuteResult(ControllerContext context)     {         context.HttpContext.Response.Clear();         context.HttpContext.Response.StatusCode = 201;         context.HttpContext.Response.ClearHeaders();         context.HttpContext.Response.AddHeader('Location', Location);     } } 

And my action looks something like this:

[AcceptVerbs(HttpVerbs.Post)] public ActionResult CreateNew(string entityStuff) {     Entity newEntity = new Entity(entityStuff);     IEntityRepository entityRepository = ObjectFactory.GetInstance<IEntityRepository>();     entityRepository.Add(newEntity);      ActionResult result = new ResourceCreatedResult()         { Location = Url.Action('Show', new { id = newEntity.Id }) };     return result; } 

However, IE, Firefox and Chrome all fail to redirect to the new resource. Have I messed up generating the correct response, or do web browsers not expect this type of response, instead relying on servers to send a Redirect response?

  • 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. 2026-05-11T01:59:28+00:00Added an answer on May 11, 2026 at 1:59 am

    Redirect after post or post/redirect/get is something your application must do to be user friendly.

    Edit. This is above and beyond the HTTP specifications. If we simply return a 201 after a POST, the browser back button behaves badly.

    Note that Web Services requests (which do NOT respond to a browser) follow the standard completely and do NOT redirect after post.

    It works like this.

    1. The browser POSTS the data.

    2. Your application validates the data. If it’s invalid, you respond with the form so they can fix it and POST.

    3. Your application responds with a redirect.

    4. The browser gets the redirect and does a GET.

    5. Your application sees the GET and responds.

    Now — hey presto! — the back button works.

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

Sidebar

Ask A Question

Stats

  • Questions 107k
  • Answers 107k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Replace all the following code # Re-raise errors caught by… May 11, 2026 at 9:00 pm
  • Editorial Team
    Editorial Team added an answer MSDN says that LogonUser is in Advapi32.lib. It looks like… May 11, 2026 at 9:00 pm
  • Editorial Team
    Editorial Team added an answer Suitable Mock Objects should let you perform such simulations easily;… May 11, 2026 at 9:00 pm

Related Questions

I have a web service that I can only hit if I'm logged into
I've written a web service using ASP.NET (in C#) and I'm attempting to write
Hey, I am so close to fininshing my guess a number game, very simple
Thanks to help I previously received on this forum I was able to get

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.