http-status-codes

Setting HTTP Status in ASP.NET MVC controller results does not render view.

I have a custom ActionResult for returning certain HTTP Errors, like NotFoundResult and ForbiddenResult, they all derive from ViewResult. I use them for instances like short circuiting actions with a 404 if an entity was not found in the database during the course of an action. Within these result objects, I set the HTTP Status to the ...

HTTP status code = 0 (iPhone) (objective c)

Hello, I want to ask about the iPhone application objective C problem. I wrote a program to store the cookies and pass to another URL to retrieve the cookies. However, I found that one of the return status code is 0. The content of the html is empty. Can any one help me? The following is my code. // create a new mutable url NSMutab...

Set the certification to the NSHTTPURLResponse in iPhone

Hi all, I would like to send some information to a 'HTTPS' server and get the cookies and html code from the server. I have already complete the cookies and the html part. However, when I use the 'GET' method to set the url and use the statusCode to see the http status code, I found that the status code is 0. I found the error is about ...

why do site redirects appear in Google results?

Inishturkbeg.com query. If you search "inisturkbeag" (which should people apparently do), you get inisturkbeag.org, which redirects to inishturkbeg.com. Is there any way we can remove these from Google? Is it an ISP thing? ...

Why does Web Server respond "304 Not Modified" when no Etag and no "If-Modified-Since" is in request header

I get back 304 Not Modified from the web server, but in Firebug, the request header doesn't have Etag and doesn't have If-Modified-Since, and I looked at all the header line and there was no datetime info at all, so how does the server know the content is not modified? ...

Validate status of URLs in a mysql Database using CURL and shell script.

Good day, I have a simple MySQL database with 1 table and 3 fields Table: LINKS Fields: ID URL STATUS The table has about 3 millions links. I would like to check all the URLs and post their returned status in the status field so that I can remove the dead links later. This would probably require a shell script because it will nee...

jboss authenticate return http code 408

I am trying to authenticate into JBoss, and I got HTTP Status 408 - The time allowed for the login process has been exceeded.(full error message below) this happens when I try to login using http://dnsname:8080/authenticate if I replace this with just plain localhost ie http://localhost:8080/authenticate then everything works fine. W...

Returning successful/failed AJAX responses, and HTTP-status codes

Let's say I have a StackOverflow-esque site. I want to post a comment underneath someone's answer. Two things can happen: 1) The comment post is successful. I return the actual formatted DIV as some JSON response, set the JSON. { "Success": true, "Data": "some escaped html to inject" } 2) The comment post is unsuccessful. I ...

Page not rendered when sending statuscode 500 to the client

I have a page (generic handler) on which I want to return the status code 500 to the client to indicate that something is wrong. I do it like this: Response.StatusCode = 500; Response.StatusDescription = "Internal Server Error"; And at the same time I render a friendly message telling the user that something went wrong. But instead of...

REST HTTP status codes

I'm building an application with a REST-based API and have come to the point where i'm specifying status codes for each requests. What status code should i send for requests failing validation or where a request is trying to add a duplicate in my database? I've looked through http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html but n...

Setting Context.Response.StatusCode does not seem to work

I have an HttpHandler with the following code: using System; using System.Web; using Company.Cms; using Company.Web.Handlers.Console; namespace Company.Web.Handlers { /// <summary> /// Summary description for AdminHandler /// </summary> public class AdminHandler : IHttpHandler { public bool IsReusable ...

Correct 30X redirect to use for arg remapping/expansion

I have a dynamically generated HTML page that uses Google charts. The things is that the page generator doesn't have easy access to the data the chart needs to display. So my thought is to have it instead generate a URL that encode what it does know and that point at another server that does have access to the data. This sever than gener...

XmlHttp Request status 0, localhost issues (javascript, ajax, php) help

Hi, I am using xampp to test my codes. I am using dreamweaver live view. In live view, and return a xmlhttp.status code of 200 and echo outputs. But when I try to view it in IE or FF, the status code is 0, and no output. I read that this seems to be a problem with the URL (absolute/relative??), I tried multiple URL formats, but can't...

Specify supported media types when sending "415 unsupported media type"

If a clients sends data in an unsupported media type to a HTTP server, the server answers with status "415 unsupported media type". But how to tell the client what media types are supported? Is there a standard or at least a recommended way to do so? Or would it just be written to the response body as text? ...

SEO way to handle ajax requests used for reporting

We would like to perform some link tracking in our application but I am unsure of the proper way to handle this. For example with on our search results page we obviously have a bunch of search results. We would like the link for each item to: a) link to the actual item description b) fire off an ajax request to a url that handles link ...

Jersey Viewable with status code

The JAX-RS implementation Jersey supports MVC style web applications through the Viewable class, which is a container for a template name and a model object. It is used like this: @GET public Viewable get() { return new Viewable("/index", "FOO"); } I wonder how a status code could be returned with this approach. The above would impl...

What is the correct status code for a RESTful resource when the request method is allowed, but the action cannot be completed

... due to server-side rules. Specifically, I have comments that nest, and I am forbidding the deletion of comments with children. So when someone requests: DELETE /comments/5 where the 5th comment has children, I do not allow the comment to be deleted. What is the appropriate HTTP status code? I use a 405 elsewhere on the site, but...

Which Http Status code to return when user provided data fails validation in Web Service?

When the user enters data and submits that data, we pass it to the server using and XMLHttpRequest. But, if that data fails validation, we have to return a 400 level status code. I thought the appropriate code would be 403. However, my colleague doesn't agree but doesn't know which to use. Which one would you use? Thanks! ...

WCF 4 REST service can't return a StatusDescription, only StatusCode

I'm currently migrating my WCF RESTful service from .NET 3.5 (Starter Kit) to .NET 4. I started my project using a WCF Rest service template from Visual Studio 2010. I had to figure out how to keep my authorization scheme (formely done with RequestInterceptor) using ServiceAuthorizationManager. After some work and researching I got it do...

How to retrieve error message from an AJAX error callback in Grails ?

I am sending the following AJAX request : $.ajax({ type: 'POST', data: $(this).parents('form:first').serialize(), url:'/myapp/comment/saveOrUpdate', success: function(data,textStatus) {insertNewComment(data)}, error: function(xhr, textStatus, errorThrown) {alert(xhr.responseText);} }) ...and my controller action looks like this ...