• Home
  • Technology
    • Ebullientech
    • Entrepreneurship
    • Video Technology
    • Cloud Computing
    • Business Analysis
  • Healthcare
    • Pharmacology
  • Thoughts
    • Food
    • General
    • Stories
    • Places
    • Workplace
    • Social Issues
    • Reviews
  • Quotes
  • Ebullientech News and Events
  • About

Kamalika's Notebook

thinking nothing...............!!

HTTP Status Codes

April 19, 2015 By Kamalika 4 Comments

What is Http?

As per Wikipedia definition… “The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web. Hypertext is structured text that uses logical links (hyperlinks) between nodes containing text.”

Whenever a request is made to a server for any page (webpage) of any website an HTTP status code is the response to the request. A request is made when a search engine crawler (like Googlebot) crawls the page or a user tried to open the page in a web browser.

This status code provides the information about status of the request. Some of the common status codes are:

  • 200 – The server successfully processed the request. Generally, this means that the server provided the requested page
  • 301 – The page is permanently moved
  • 404 – The requested page doesn’t exist
  • 500 – Internal server error

HTTP Status codes are always three-digit numbers. The first digit of status code begins with one of five numbers, 1 through 5. From the 100s through the 500s, status codes are divided into following categories:

  • 100s – Informational: Request has been received and the process is continuing
  • 200s – Success: Request was received and processed successfully
  • 300s – Redirection: Request has been received, but needs to perform an additional step to complete the request
  • 400s – Client Error: Request was made by the client, but the page is not valid
  • 500s – Server Error: Valid request was made by the client, but the server failed to complete the request

Below I have shared a few learning resources on HTTP Status Codes:

  • Wikipedia: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
  • IETF: http://www.ietf.org/assignments/http-status-codes/http-status-codes.xml
  • W3C: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  • REST API: http://www.restapitutorial.com/httpstatuscodes.html

HTTP Status Code and PHP

PHP has a function http_response_code which gets or sets the HTTP Response / Status Code.

If you pass no parameters then http_response_code will get the current status code. If you pass a parameter it will set the response code.

[php]

<?php

http_response_code(404);

echo http_response_code();

?>

[/php]

The above code will first set the http status code to 404 and then print the current status code, i.e., 404.

Please note that this http_response_code was introduced in PHP 5.4.

Filed Under: Apache, HTTP, Technology Tagged With: Cloud Architect Mumbai India, http, http status codes, Tech Consultant Mumbai India

Let’s connect…

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Hello There…

I'm Kamalika, a techpreneur & startup mentor, blogger, hobbyist photographer, Netflix & Kindle indulgent, food connoisseur, Starbucks aficionado and former Disney employee ...next

Looking for something?

Tags

All in One SEO Pack AWS Banaras Blogger Blogging Blogs Dasaswamedh Ghat Ebullientech Ebullientech Interactive LLP Facebook Facebook Developers father's day father's day wishes father's day wishes for dad fathers day love Fathers Day Special Fathers Day wishes from daughter Father’s day memories GeoTech GeoTech Informatics HipHop for PHP Kamalika Guha Roy Kashi Ganga LAMP MySQL Nabaneeta Guha Roy Online Marketing PayPal PayPal's suspension of Indian bank transactions PHP PHP & MySQL Saraswati Puja Search Engine Optimization SEO Startup The Ganges TypePad UCO HUT Varanasi Web 2.0 Web 2.0 Design Web Design Web Marketing WordPress WordPress.COM

Timeline

  • 2021 (3)
  • 2020 (7)
  • 2019 (4)
  • 2018 (1)
  • 2015 (6)
  • 2014 (13)
  • 2013 (9)
  • 2010 (7)
  • 2009 (2)

Topics

Copyright © 2021 · Kamalika Guha Roy, Powered by: Ebullientech