http-status-codes

How to check for an HTTP status code of 401?

In one of the answers that I have received here, I encountered a problem of not knowing how to pass automatically through "Google App Engines" my ID and a password to a website, on which I am a registered user and have an account. A suggestion was given to me to "check for an HTTP status code of 401, "authorization required", and provide...

What's an appropriate HTTP status code to return by a REST API service for a validation failure?

I'm currently returning 401 Unauthorized whenever I encounter a validation failure in my Django/Piston based REST API application. Having had a look at the HTTP Status Code Registry I'm not convinced that this is an appropriate code for a validation failure, what do y'all recommend? 400 Bad Request 401 Unauthorized 403 ...

"I am a Teapot" HTTP 418 Status Code

There seems to be an HTTP Status code 418: "I am a teapot". What does it do? Is it supported by all the browsers? ...

Get long descriptions of http status codes in asp.net (IIS7)

I've set up a custom error page to handle errors thrown through my site. I'm running asp.net 3.5 with IIS 7.0 on Godaddy shared hosting ("deluxe" account). Normally, if I set Response.StatusCode = 412 the server outputs: Server Error 412 - Precondition set by the client failed when evaluated on the Web server. The request was not comp...

When to show 404 versus 301?

So I've been noticing some strange results in how google peruses our site. One issue is that a url such as this: http://example.com/randomstring is showing up on google with all of the data of http://example.com/ So in my mind there are two solutions. One is to add a 301 redirect whenever someone visits a sub-url of the main one, a...

jQuery Ajax - Status Code 0?

For some reason, my Dashcode developed application has just stopped ajax'ing and returning status codes of 0. Does anybody have any idea why.. has this happened to you? ...

Server Response: err404.html HTTP Status Code: HTTP/1.1 200 OK

hi friends 404 error page's 200OK header error what is this? Server Response: http://www.blabla.com/err404.html HTTP Status Code: HTTP/1.1 200 OK and it should give 404, my client says.. i researched so much by google, but could not understand the issue.. What should I do to fix this? appreciate helps!!! ...

What HTTP Status Codes Should Programmers be Concerned With?

So, if you look at the List of HTTP Status Codes, there are probably a number of them that would be useful while programming. The server might handle some things, like protocols, but a lot of these codes could be useful in telling the browser the actual status of the page. So, my question is which of these status codes should we be con...

Can PHP detect the status code that it has or is preparing to send to the browser?

I am sending a status code via the header function, such as header('HTTP/1.1 403');, and would like to in another area of my code detect what status code is to be sent (in particular if I have sent an error code of some nature). As has been mentioned elsewhere, headers_list() does not return this particular item, and it's unclear to me i...

How to return a 200 ok status programmatically to ajax request in PHP?

I ask this question for the comment of this answer: http://serverfault.com/questions/104648/is-this-http-servers-issue/104679#104679 EDIT I missed an important point,should also keep the connection not closed. You guys can smell I'm trying to figure out how long polling actually works. ...

Retrieving HTTP status code from a loaded xul:browser tag

Thanks to everyone in advance - I took a look at this - http://stackoverflow.com/questions/1549831/an-observer-for-page-loads-in-a-custom-xulbrowser I am guessing that might be a path for determining the HTTP status code, but does anyone know of an easier way? I have flipped through the contentDocument as well...no dice. Any ideas? ...

C# HttpWebRequest.GetResponse - how is StatusCode usage handled for a non-exception vs webexception response?

Hi, Can someone help clear up the usage of the "StatusCode" property in HttpWebResponse and WebException? For example it seems that if: a) there is no exception, then the HttpWebResponse will have a StatusCode that could have some values that indicate both: - success (e.g. OK, Accepted etc) - failure (e.g. UseProxy, RequestTimeout...

HTTP Error Codes - Is there a sites with pages/sites that give (produce) the various error codes?

Hi, For testing purposes it would be nice to have a site that has links that align with the various HTTP error codes (or at least the main ones), that is they will produce the associated error page. For example a link that will produce a 501 etc. (I am NOT looking for a list of HTTP error codes) Is there a sites with pages/sites that...

ASP.NET MVC Redirecting to default page/route when content is not found

Let me say I have a route/action for showing content pages like this: /Page/{slug} where {slug} can be anything that a visitor types in but if left empty it defaults to "Default". I have my route definition handle the case where {slug} is empty or Default or anything else, so that is setup fine. Now, what do you do in those cases wh...

Http Status Code 301 to a page that return 410

I have been asked by a client to return a 410 Status code for some URLs in a previous version of there site. I have two options for how to programe this (based on constraints outside the scope of this request) Option 1 this is easy to implement: use an existing old urls redirector (301 status code) to redirect all those urls to a singl...

Catch PHP Fatal Error

I have a web service site that is restful enabled, so other websites/ajax script can make a call to the site to get/set data. However, whenever the web service site somehow returns a PHP fatal error, the HTTP status that is returned is 200 instead of 500. Is there a way to fix it so that whenever a fatal error occurs, returns 500 instead...

Rail status codes and XML

Hey... Controller: class CategoriesController < ApplicationController def create @category = Category.create(...) respond_to do |format| if @category.save format.xml { :status => :created } else format.xml { :status => :unprocessable_entity } end end end end View: xml...

HTTP status code for update and delete?

What status code should I set for UPDATE (PUT) and DELETE (e.g. product successfully updated)? Thx ...

What HTTP status code should I return that tells the browser to stay in the current page?

I have a table with lots of generic link from a DB. Now the customer wants to restrict certain types to be linked (or showed). Changing the page that makes the links is very hard, so I want to show some alert to user but would be ideal that the browser stays in the page, instead of navigation to an empty one and force the user o press b...

REST: Mapping application errors to HTTP Status codes

Is it to be considered good practice to reuse RFC HTTP Status codes like this, or should we be making up new ones that map exactly to our specific error reasons? We're designing a web service API around a couple of legacy applications. In addition to JSON/XML data structures in the Response Body, we aim to return HTTP Status Codes tha...