Posts

Showing posts from April, 2019

HTTP Status codes

Image
Just kidding... Have you ever come across this message when you try to access a certain web page? Ever wondered what 404 stands for? In this mini blog we are going to look at some widely used status codes in HTTP. Types of HTTP Status codes 1xx : Informational Status code. These codes keeps the client informed of basic headers. 2xx : These codes reflect a successful response or operation 3xx : Redirection codes 4xx : Client Error codes (404) 5xx : Server Error codes Now, we'll look at some commonly used status codes. 2xx 200 - OK Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource.  201 - Creat This status code is sent as a response when the request was a POST method. If the POST request was successfully sent and processed, we get a 201 status code. 204 - No Content The request was successful...

Node.js

What is Node.js? Node.js is a free and open source server environment. That is, Node.js brings JavaScript to the server and guess what it is platform independent. Node.js lets developers use JavaScript to write command line tools and for server-side scripting to produce dynamic web page content before the page is sent to the user's web browser. Consequently, Node.js represents a "JavaScript everywhere"  unifying web application development around a single programming language, rather than different languages for server and client. Node.js was implemented by Rian Dahl in 2009 and combines the following, Google Chrome's V8 engine An event loop Package management (npm) Chrome V8 Engine This compiles JavaScript directly to native machine code before executing it, instead of more traditional techniques such as interpreting bytecode or compiling the whole program to machine code and executing it from a filesystem. The compiled code is additionally optimized...

Take some REST

Image
RE presentational S tate T ransfer! What is REST? (REST API) Let’s say you’re trying to find videos about Avengers on Youtube. You open up Youtube, type “ Avengers  ” into a search field, hit enter, and you see a list of videos about  Avengers . A REST API works in a similar way. You search for something, and you get a list of results back from the service you’re requesting from. Wait... What is an API? API stands for Application Programming Interface which will have a set of rules that allows the programs to talk to each other over a protocol. The developer creates the API on the server (host)  API One of the rules in REST states that the user should be able to get a piece of data, which is called resource, when linked to a specific URL. When doing this, certain security filtering may done when user tries to get to the resource through that URL. For example, application might filter only logged in users to view certain resources. Each lin...