Web Server Error Codes

Code Name Description
0 Server Error No connection to the server available or the server was unavailable.
300 Multiple Choices The requested resource corresponds to multiple representations, each with its own specific location, and the negotiation information is being provided so that the user can select a preference and redirect its request to that location.
301 Moved Permanently The requested resource has been assigned to a new permanent URL.
302 Moved Temporarily The requested resource resides temporarily under a different URL. Clients should continue to use the URL since the redirection may vary.
303 See Other The response to the request can be found under a different URL. The new URL is not a substitute reference for the originally requested resource.
304 Not Modified If the client has performed a conditional GET request and access is allowed, but the document has not been modified.
305 Use Proxy The requested resource must be accessed through the proxy given by the location field.
400 Bad Request The request is not understood by the server due to an incorrect syntax.
401 Unauthorized User authentication is required.
403 Forbidden The server understood the request, but is refusing to fulfill it.
404 Page Not Found The server has not found the URL requested.
405 Method Not Allowed The method specified in the Request-Line is not allowed for the resource identified by the Request-URL.
406 Not Acceptable The server is not sending a response that the requestor is willing to accept.
407 Proxy Authentication Required The client must authenticate itself with the proxy (similar to Unauthorized).
408 Request Timed Out The client did not produce a request within the time that the server was prepared to wait.
409 Conflict The request was not complete due to a conflict with the current state of resources.
410 Gone The requested resource is no longer available at the server and no forwarding address is known (similar to 404, but 410 is permanent).
411 Length Required The server refuses to accept the request without a defined content-length.
412 Precondition Failed The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
413 Request Entity Too Large The server is refusing to process a request because the request entity is larger than the server is willing or able to process.
414 Request-URL Too Long The request entity is larger than the server is willing or able to interpret.
415 Unsupported Media Type The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
416 Requested Range Not Satisfiable The request included a Range request-header field, and not any of the range-specifier values in this field overlap the current extent of the selected resource, and also the request did not include an If-Range request-header field.
417 Expectation Failed The expectation given in the Expect request-header could not be fulfilled by the server.
500 Server Error The client?s Web server is incapable of performing the request.
501 Not Implemented The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.
502 Bad Gateway The server received an invalid response from the upstream server that it accessed in attempting to fulfill the request.
503 Out of Resources The server is unable to handle the request due to a temporary overloading or maintenance of the server.
504 Gateway Timeout The server did not receive a response in time from the upstream server specified by the URL.
505 HTTP Version Not Supported The server does not support the HTTP protocol version that was used in the request message.

Happy Coding 🙂


JavaScriptSerializer set MaxJsonLength Property

I was working on WCF Service where I need to return large data in JSON format. We are using JavaScriptSerializer to perform operation. But we are facing following issue:

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

While searching, I ended up with following solution:

The default maximum length for MaxJsonLength is 102400 characters.

The value of the MaxJsonLength property applies only to the internal JavaScriptSerializer instance that is used by the asynchronous communication layer to invoke Web services methods. (MSDN: ScriptingJsonSerializationSection.MaxJsonLength Property)

You can set the MaxJsonLength property on your web.config:

<jsonSerialization maxJsonLength=”2147483644″/>

If you are still receiving the error:

As a workaround, you can do the following within code

var serializer = new JavaScriptSerializer();

serializer.MaxJsonLength = Int32.MaxValue;

string jsonresult = serializer.Serialize(rowData);

Happy Coding 🙂

Microsoft Introduce ASP.Net WebHooks

Microsoft Introduce ASP.Net WebHooks. In the MSDN blog article you will get an overview of how to work with Microsoft ASP.NET WebHooks. Microsoft ASP.Net Webhooks make it easy to send and receive webhooks from web application.

MSDN Blog:

Introducing Microsoft ASP.NET WebHooks Preview

Sending WebHooks with ASP.NET WebHooks Preview

Happy Coding 🙂

Check foreign key constraints in SQL Server Database

While searching for how to find Primary Key and Foreign Key relationship using INFORMATION_SCHEMA in SQL Server Database, I came across following query which works for me.


You can also find Foreign Key using EXEC sp_fkeys ‘<TABLE NAME>’

Happy Coding 🙂

Auto Update Copyright Year using JavaScript

Copy the script code below and paste it into your website where you want your copyright notice to appear.

<script language=”javascript” type=”text/javascript”>

document.write(‘©’ );


document.write(new Date().getFullYear());


Happy Coding 🙂