Docker Compose – Dockerizing Nodejs MySQL REST API CRUD Example

Introduction In this tutorial I am going to explain you how to use docker compose to dockerize your Nodejs MySQL REST API for CRUD operations. I am not going to tell you here how to build the REST CRUD application but you can always go back and check the detail tutorial on this here. I am only going to show you how to dockerize your app using docker compose in Linux environment. It is a best practice for a container to have only one process with single responsibility. But as…

Continue

How to use Swagger with Python based Django REST APIs

Here in this tutorial I am going to show you how to use Swagger API with Django REST framework. Swagger API provides well structured documentation for REST API endpoints so a new person can say how to test a REST API without knowing its internal implementation. Essentially, Swagger does a simple but very powerful thing: with a bit of additional annotations it generates the REST API descriptions such as HTTP methods, path / query / form parameters, responses, HTTP error codes etc) and even provides a simple web UI to…

Continue

REST API – HTTP GET with Request Body

Here we are going to discuss about whether it is a good idea to send parameter in request body of the HTTP GET request or not. We will also discuss about idempotent and safe methods. When you are doing a GET request on entity, you are actually requesting the content of the entity. If you want to add some parameters (for example sorting a list in ascending or descending order), you can add these parameters in the query string. Alternatively you may also want to specify these parameters in the…

Continue

File Upload and File Download REST APIs Testing using Rest Assured in Java

Introduction In this tutorial we will test REST APIs used for file upload and file download. The file upload or download application might have been created using any server side technology. We are going to use here Rest Assured library with Junit 5 framework in Java programming language. We will use multipart for file upload test. For download test you don’t need such content type – multipart. The fluent API used by REST Assured supports the familiar Given/When/Then syntax from behavior driven development (BDD) framework, resulting in a test that is easy…

Continue

How to perform CRUD operations REST API testing using Rest Assured in Java

Introduction In this example we will see how to perform CRUD operations REST API testing using Rest Assured library in Java programming language. Testing and validating REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain. This tutorial will show you how to test REST APIs which perform CRUD (Create, Read, Update and Delete) operations. So we will perform testing on HTTP methods GET, POST, PUT and DELETE. REST Assured can be…

Continue

Documenting REST APIs with OpenAPI 3

Introduction This tutorial will show you an example on how to document REST APIs using OpenAPI 3. When creating a REST API, good documentation is instrumental. Here we will use OpenAPI 3 in Spring application for creating documentation for REST APIs. We create and deploy REST services but we do not have an option to let others know in a single place, where REST services, having methods, request body, request params, etc., are exposed for consumption. Here we will take a look at SpringDoc — a tool that simplifies the…

Continue

PHP REST API Authentication using JWT

Here in this tutorial we will see how to use JWT (JSON Web Token) to authorize users and allow them to continue their works once they are logged in using their regular credentials (usernames and passwords). Users use their credentials to get the JWTs and continue their work until JWTs expire. We will not use any third party library to generate JWT in our example. We have seen how to generate and validate JWT using PHP language without using any third party library. Here we will use the same concept…

Continue

PHP REST API AJAX jQuery CRUD Example

Introduction In this example we will see an example on PHP AJAX jQuery CRUD. CRUD is an acronym for four operations such as Create, Read, Update and Delete. We are going to perform CRUD operations on company details. We will use here MySQL database to store company detail information. We will perform each operation asynchronously through AJAX technique using jQuery on client side and PHP in server side. We will create here REST APIs using PHP and call those REST APIs through jQuery AJAX from front-end. I am going to…

Continue

Python Flask REST API Login Logout Example

Introduction We will create REST APIs to allow users login and logout from an application using Python and Flask. We have seen in another tutorial how to login and logout from an application where UI or front end was built using flask template file but here we are not providing any UI or front end but UI or front end can be built using any technology or framework. So it is decoupled from the UI or front end technology. We know when we need to restrict users from accessing protected…

Continue