http-response-codes

How can send back my own 404 error message in ASP.NET , but as json?

Hi folks, i'm trying to send back a simple error message as Json, with the HTTP code as 404. So i started out writing my own IExceptionFilter that checks to see the exception. To keep this simple, if the exception throw is of type ResourceNotFoundException then i set the code to 404. Otherwise everything else if 500. Now, the problem ...

Signalling authentication failure in a RESTful API

I'm writing a small application which exposes a simple REST-ish HTTP API. I'm stuck trying to decide how to signal a failure due to a lack of authorization. The app does not have an API for authentication, but instead depends upon the presence of a cookie containing a session token obtained by the client via another service. The app v...

Tracking and testing for abusive clients in PHP

Now there is a subject that could be taken many ways. Hopefully I will be able to de-obfuscate it as I describe my problem and start getting suggestions. I am developing a site that will be replacing an existing one. Historically one of the problems we have had is spider bots coming in and sucking down all out content. Now we don't m...

Axis 1.4 Java: Modify HTTP response code

Hello, Is there a way to modify the HTTP response code when using apache axis 1.4 for java? This would be useful for testing purposes, for example simulating server side errors. I've already tried the following: Set the HTTP code directly in the http servlet Request: MessageContext context = MessageContext.getCurrentContext(); ...

PHP Curl get HTTP code, not whole document

I'm using curl in PHP to check the HTTP code when requesting some files, I'm trying to make my speed run faster so I'm wondering is there a way to make it get the HTTP code without actually getting the web page from the remote host ...

What is the correct HTTP status code to send when a site is down for maintenance?

Is there a HTTP status code to tell Google (and others) to go away, index me again later? Basically, one that semantically tells clients that the site is down for maintenance? The ones I have considered are 304 => Not modified 307 => Temporary redirect 410 => Gone 503 => Service Unavailable I'm leaning towards the last one, but was ...

Checking Response Code C#

Hi All I was wondering if there's a way to detect the response codes on a website using C#? Since C# .NET has HTTP-based methods, I'm assuming that it can be done? Thank you ...

PHP: How to send http response code?

I have a PHP script that needs to make responses with http response codes, like HTTP 200 OK, or some 4XX or 5XX code. How can I do this in PHP? ...