Skip to main content

Backend Developer & Development [ Part 2 ]

Incoming Requests

In incoming requests, you must know about HTTP verb / method, queries, params, headers, body and flows. 

For HTTP verb / method, there's are many but i only introduce most common one. All of the method have their own usage like
  • GET           -  For client GET data from server-side
  • POST         -  For client POST data at body to server-side for creation or other requests that used post body.
  • PUT            - For client replace specific data with body given.
  • PATCH       - For client update partial data with body given.
  • DELETE    - For client delete specific data from server-side.

For queries, params, headers and body, they like a message that from client. 4 of them will receive on different places.

  • Queries  - Can found at behind of the URL. Look like ?value=abc.
  • Params   - Defined by backend developer when routing. Look like 'sampleurl.com/:id' when pass 'sampleurl.com/123', id would be 123.
  • Headers - Using postman you will see some default headers like Content-Type, X-Response-Time and Content-Length. Most of the backend would implement these headers and for authorized usage also.
  • Body      - When method POST used most of the backend developer would pass data using post body. For now many of the framework have default used JSON as parser.
As incoming requests to processing requests, they would pass into middleware of the backend framework. Most of the time they will checking body is it JSON and authorized access. Once all the condition pass only will start processing requests. After processing data, it will response to client that i called it outgoing response.

Outgoing Response

In outgoing response, you must know headers, response and status. Response most of the time is same structure, cause only need to reply to client is it success or not, fail due to what and success with payload that client needs. Headers would be quite same with incoming requests, what different is on framework, some of the framework would add customized on it. Status would be a verb like HTTP method, it is a number that can defined many means.
  • 200+ - Success
  • 300+ - Redirection
  • 400+ - Client error
  • 500+ - Server error
In a short saying on these would be like that for more information you can look into https://developer.mozilla.org/en-US/docs/Web/HTTP/Status.

Processing Requests

There was a complete flow from incoming until outgoing. And another you need to know is type for processing requests, it can be sequential or parallel. 
  • Sequential  - mean only process one requests whatever how many requests has send to the server
  • Parallel       - mean process multiple requests at the same time
We will stop here, Next time will talk about framework features and how they work.

Popular posts from this blog

Backend Developer & Development [ Part 1 ]

Backend developer is a develop who maintain the work users /  clients can't see such as processing transaction, data structure, data transfer. These works would contains in a API server and API server contains many endpoint that can call by anyone but only success when fulfill endpoint requirements so it is secured. API Server also know as REST API ( Representational State Transfer ). It's processing like client request to server & after server process return response to client. API Server is develop by backend developer and this api server can be many type and different language, different framework such as Ruby on Rails ( RoR ) using Ruby Python PHP ( Laravel & Yii2 ) Java ( Spring ) C# ( ASP.NET & NancyFX ) Node.JS ( ExpressJS, SailsJS, HapiJS, NestJS, FeatherJS ) Different framework have their own advantages and can be used on different projects based on their features and usage. In the development not only choosing frameworks also need to ch...

Local Development | LAN [ Local Area Network ]

Before an application, website, backend server, frontend app or any application required to integrate with another platform, how you work with your friends? Put all in one computer for testing?  Upload to a free hosting for testing like Heroku ? If your team able to work in same place, i would suggest hosted own local network for testing at least faster then using other free platform like Heroku. As of improvement of technology, nowadays network interface card ( NIC ) would have a feature about HostedNetwork. You can host your local area network ( LAN ) for your friends and they can access your works and testing at their own computer and fix would faster the development. In Windows You can use command prompt and type "netsh wlan show drivers" and check is "Hosted network supported : ". If supported you can create your local area network by using command "netsh wlan set hostednetwork mode= allow ssid= YourAP key= YourPW ". YourAP  = Acc...

Coming back to MinecraftAPI

A long time for stop developing minecraft plugins due to busy about university and side works. Coming back from a long learning journey, i decide to recode my personal minecraft api for upcoming new server. Found that the code now i can build it with more structural design pattern. Such as MinecraftAPI interface class for runtime reloadable content. package me.oska.core.abs; public interface MinecraftAPI { void register(); void unregister(); void intialise(); void teardown(); } Also i have updated my reader utility code for reading jar class with functional interface make it more flexible. package me.oska.core.util; import me.oska.core.OskaCore; import me.oska.core.lambda.VoidAction; import org.apache.commons.io.FilenameUtils; import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; public class ReaderUtil { public static void readJAR(File fold...