HTTP basics – PUT vs POST vs PATCH, what is the difference?

While designing our APIs, we often need to make a decision, which method do we’d like to choose to create a new resource on the server.

Will it be POST or PUT?

But hey, wait a minute, there’s still a PATCH method. Will it be suitable for this purpose?

In this short text, I’m going to go through all these methods and show you what are the best use cases for each of them.

Continue reading HTTP basics – PUT vs POST vs PATCH, what is the difference?

Provide basic security for your Spring Boot application with Spring Security and Kotlin

When you’re creating your REST API, most of the time you don’t want it to be publically accessible. Moreover, sometimes you’d like to restrict certain paths for users with specific roles (for example administrators).

In this blog post, I’m going to provide very basic Spring Security integration for Spring Boot application written in Kotlin language.

Please note that I’m using the example REST API I provided in the previous article. So if you don’t have your Spring Boot REST API built yet, move through the steps I described there.

Continue reading Provide basic security for your Spring Boot application with Spring Security and Kotlin

Swagger documentation for your Spring Boot API with Springfox

If you’d like to provide Swagger documentation for your Spring Boot REST API in a nice way, you’re in the right place.

Today I’m going to show you how you can achieve it in an automated way, without using tons of annotations in your controllers.
Springfox is a nice tool that allows you to do it.

In this text, I’ll be using the REST API built previously in this text using Spring Boot and Kotlin language, as an example.

Continue reading Swagger documentation for your Spring Boot API with Springfox

REST API with Spring Boot and MongoDB using Kotlin

If you think about Kotlin you could probably think about Android and mobile development.
It’s true. When Google announced Kotlin as the preferred language for the Android platform, its overall popularity increased sharply.

According to The State of Developer Ecosystem 2019, the survey made by JetBrains (Kotlin language creators), 62% of Kotlin-based apps were mobile. But 41% of Kotlin projects were related to web back-end development.

Indeed, Kotlin may be a good choice for server-side development. Among other frameworks, Kotlin is one of the officially supported languages of the Spring Framework.

In this text, I’d like to show you how easy it is to create a Spring application using Kotlin. I’m going to implement a simple CRUD REST API with Spring Boot and MongoDB as a database using Kotlin as a language.

So, get started with implementation and try it yourself.

Continue reading REST API with Spring Boot and MongoDB using Kotlin

Web scraper and RSS feed generator with Spring Boot

Rich Site Summary (RSS) is not quite state-of-art technology but thanks to its simplicity RSS feeds are still useful nowadays.

In this post I’ll show you how you can parse websites and provide your own RSS feed with Spring Boot and few useful libraries such as JSoup and ROME.

Please note: This post isn’t a step-by-step tutorial. The source code with fully working example can be found on GitHub.

Continue reading Web scraper and RSS feed generator with Spring Boot

Run performance test on your endpoints with JMeter

Recently I was testing and comparing cloud functions services. For this purpose the JMeter was chosen to provide simple single endpoint test. Today I’d like to share the whole process with you. It’s really easy, so let’s go through it.

In this short tutorial you’ll learn how to use JMeter to run simple performance test for single web service endpoint (or a website) using HTTP/HTTPS requests and generate the test report.

Continue reading Run performance test on your endpoints with JMeter

Send push notifications from Spring Boot server-side application using FCM

As you probably noticed, I familiarize myself with the subject of Firebase Cloud Messaging push notifications recently.

This time I would like to share with you my push notifications server-side application. The app is made with the Spring Boot framework.

The provided example covers most common notifications sending use cases such as: sending push notification to a topic, directly to the users’ device or sending messages with additional data payload.

This post is not a step-by-step tutorial. I’ll focus on the most important parts. A fully working example is available on GitHub.

If you don’t have a client-side application to receive push notifications yet, you should consider the use of the Ionic app I described earlier. Have fun!

Continue reading Send push notifications from Spring Boot server-side application using FCM

OpenWeatherMap – best weather data API for your projects

Recently Weather Underground announced that they’re no longer supporting their free API plans.

I really liked WUnderground and used it in several projects, but if you’re relaying on external services you have to remember that your API provider can change. So don’t tie yourself with specific solution.

Continue reading OpenWeatherMap – best weather data API for your projects