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

Flutter codebase sharing

# Clone For master branch come with example, you can clone and run `flutter doctor && flutter run` ``` git clone --single-branch --branch master https://github.com/Oskang09/Flutter-CB2019.git ``` For codebase branch just empty codebase, but setup done you can just start your development. ``` git clone --single-branch --branch codebase https://github.com/Oskang09/Flutter-CB2019.git ``` # Plugins * Dart as "Programming Language" * Flutter as "SDK" * Redux as "State Management" * Fluro as "Navigator Router" # pubspec.yaml ```yaml name: flutter_codebase description: A new Flutter project. version: 1.0.0+1 environment: sdk: ">=2.0.0-dev.68.0 (); Router router = Router(); routers.forEach( (route) { router.define( route.routePath, handler: Handler( handlerFunc: (context, params) => route.widget(params) ), transitionType: route.transitionType ...

Async / Await vs Promises

## Node.JS In node.js, asynchronous operation able to done by two ways. They are async/await codeblock or promises. What different between them? ### Promises In promises, some of them call it `callback hell` because of the syntax keep repeating callback like and until the end of the async operation. Here come with an example. ```js samplePromise: () => { var promise = new Promise((resolve, reject) => { try { // async codeblock resolve(result); } catch (e) { reject(e); } }); promise.then( (result) => { // result is returning and async operation run complete. }, (rejected) => { // rejected something wrong when running async operation } ).catch( (error) => { // unhandled error occurs when running async opeartion } ); } ``` With this example, you able see that promise code block is quite long when running an async operation, try to think what if more complex async operation required to run, like you need to get data fr...

Global Game Jam @ 2019 January 25 - 27 with Friends

A 3 day 2 night game development event, Global game jam and held at KDU Glenmarie. With a team of 3 people, we haven't done our game until the end but we learned much on the development. Such as modeling, coding, designing, editing using software like photoshop, magicavoxel, unity. Due to inexperienced we doesn't allocate work properly and lastly only done modeling & some mechanic part like health, damage, team check. But still many mechanic haven't done like taming, spawning and more. Sadly doesn't meet our expectation but really enjoy when developing in this event, KDU's student also very friendly to we. Thanks for the all participate for sharing in this event. Event & Game Information This global game jam event title is about "What is home means to you". So we have come with idea bring characters ( player ) back to home, or with defensive feature also dialog chat. Lastly we decide with Realtime-Strategy Defensive Game ( RTS Defensive ) abo...