Posts

Understanding REST API Response Status Codes

When building or consuming RESTful APIs, understanding HTTP response status codes is essential. These codes tell the client whether a request was successful, failed, or needs additional action. In this guide, we break down the most commonly used status codes in REST APIs with simple explanations and real-world usage examples. ⭐ What Are HTTP Status Codes? HTTP status codes are standardized responses sent by a server when processing an API request. They are grouped into five categories: 1xx – Informational 2xx – Successful 3xx – Redirection 4xx – Client Errors 5xx – Server Errors For REST APIs, the 2xx , 4xx , and 5xx groups are most important. ✅ 1. Success Status Codes (2xx) These indicate that the request was successfully received and processed. 200 OK The most common success response. Used when a request is successful and returns data. Example: Returning a list of products from /api/products . 201 Created Used when a new resource is created suc...

What is Docker?

  What is Docker? From Shipping Containers to Software Containers Docker is a revolutionary technology that has completely changed the way software is developed, shipped, and deployed. If you want to become a DevOps engineer or stay relevant in modern software engineering, learning Docker is essential. But what exactly is Docker, and why is it called “Docker”? To understand that, we need to take a quick journey back into the history of the shipping industry. Before the Shipping Container Revolution The Chaos Before the 1950s Before the 1950s, loading and unloading cargo from ships was extremely slow, difficult, and expensive. Ships carried goods in: Wooden boxes Barrels Sacks Nets and odd-shaped bags Everything had different shapes and sizes, so: Hundreds of workers were needed to load/unload The cargo often got damaged Ships wasted a lot of space The process was slow and inefficient Major Problems Slow loading/unloading Expensive due...

Previewing My Laravel Localhost on Mobile Devices

As a developer, I often need to check how my projects look and perform on mobile devices, especially for responsive testing. However, localhost typically works only on the same PC. Here’s the simple process I use to preview my Laravel project on a mobile device connected to the same Wi-Fi network: Step 1 — Find Your PC’s IP Address For Windows: Open Command Prompt . Type: ipconfig Note your IPv4 Address (for example: 192.168.0.107 ). For Ubuntu/Linux: Open Terminal . Type the following commands: nmcli dev status nmcli dev show wlp2s0 Find your IP4.ADDRESS value (for example: 192.168.0.107 ). Step 2 — Run Laravel Server for All Devices Navigate to your Laravel project folder. Run the command: php artisan serve --host= 0.0.0.0 --port= 8000 This command allows any device on the same network to access your local server. Step 3 — Access from Your Mobile Browser Ensure your phone and PC are connected to the same Wi-Fi network . On your mobile browse...

Input type date default placehoder change

<input id="my_date"  name="my_date"  class="form-control"  placeholder="My Date"  type="text"  onfocus="(this.type='date')"  onblur="(this.type='text')">

CK Editor

< script src ="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js" ></ script > < script type ="text/javascript" > $ ( function () { // Replace the <textarea id="editor1"> with a CKEditor // instance, using default configuration. CKEDITOR. replace ( 'description' , { // toolbar: [ // { name: 'document', items: ['Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups. // [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', 'Undo', 'Redo' , 'Undo', 'Redo', 'Undo', 'Redo', 'Undo'], // Defines toolbar group without name. // '/', ...

HTTPS Setup With Certbot in Digital Ocean Droplets

For Installation sudo apt install python3-certbot-apache For Activation sudo certbot --apache --expand -d domainname.com

Plain php text showing issue solve

Solution: 1 sudo systemctl status php8.1-fpm sudo apt-get install php8.1-fpm sudo apt install apache2 libapache2-mod-fcgid sudo apt install libapache2-mod-fcgid sudo a2enmod actions fcgid alias proxy_fcgi Solution: 2 sudo a2dismod mpm_event sudo systemctl restart apache2 sudo a2enmod mpm_prefork sudo systemctl restart apache2 sudo a2enmod php7.0 sudo systemctl restart apache2