API Rest With Kotlin And Spring Boot

Overview

##API REST WITH KOTLIN AND SPRING BOOT

GET

Url: http://localhost:8080/customers

Response (Status Code: 200 Ok)

{
    "_embedded": {

        "customers": [
            {
                "firstName": "Felipe",
                "lastName": "Baz",
                "email": "[email protected]",
                "documentNumber": "123",
                "documentType": "CPF",
                "_links": {
                    "self": {
                        "href": "http://localhost:8080/customers/1"
                    },
                    "customer": {
                        "href": "http://localhost:8080/customers/1"
                    }
                }
            },
            {
                "firstName": "João",
                "lastName": "Baz",
                "email": "Joã[email protected]",
                "documentNumber": "1234",
                "documentType": "RG",
                "_links": {
                    "self": {
                        "href": "http://localhost:8080/customers/2"
                    },
                    "customer": {
                        "href": "http://localhost:8080/customers/2"
                    }
                }
            }
        ]
    },
    "_links": {
        "self": {
            "href": "http://localhost:8080/customers"
        },
        "profile": {
            "href": "http://localhost:8080/profile/customers"
        }
    },
    "page": {
        "size": 20,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}

POST

Url: http://localhost:8080/customers

Body

{
    "firstName": "Henrique",
    "lastName": "Baz",
    "documentNumber": "1234",
    "documentType": "RG",
    "email": "[email protected]"
}

Response (Status Code: 201 Created)

{
    "firstName": "Henrique",
    "lastName": "Baz",
    "email": "[email protected]",
    "documentNumber": "1234",
    "documentType": "RG",
    "_links": {
        "self": {
            "href": "http://localhost:8080/customers/3"
        },
        "customer": {
            "href": "http://localhost:8080/customers/3"
        }
    }
}

PUT

Url: http://localhost:8080/customers/{Id}

Body

{
    "firstName": "João",
    "lastName": "Baz",
    "documentNumber": "1234",
    "documentType": "RG",
    "email": "Joã[email protected]"
}

Response (Status Code: 200 Ok)

{
    "firstName": "João",
    "lastName": "Baz",
    "email": "Joã[email protected]",
    "documentNumber": "1234",
    "documentType": "RG",
    "_links": {
        "self": {
            "href": "http://localhost:8080/customers/2"
        },
        "customer": {
            "href": "http://localhost:8080/customers/2"
        }
    }
}

Delete

Url: http://localhost:8080/customers/{Id}

Response (Status Code: 204 No Content)

You might also like...
Sample Social Login Project of Spring Boot and Kotlin

Sample-Spring-Boot-Social-Kotlin Sample Social Login Project of Spring Boot and Kotlin dependencies dependencies { implementation("org.springframewor

The Okila server project uses the Spring boot framework and uses the Kotlin language

Okila-Server The Okila server project uses the Spring boot framework and uses the Kotlin language Format Response //The response successfully format

An application that simulate the Swedish Transport Agency, implemented with Spring Boot, Kotlin and GraphQL

graphql-kotlin-spring-server An application that simulate the Swedish Transport Agency, implemented with Spring Boot, Kotlin and GraphQL Running the s

Spring Boot built using Kotlin, H2, Postgres, Hibernate and JPA

Spring-Boot-Kotlin-Sample Spring Boot built using Kotlin, H2, Postgres, Hibernate and JPA Getting Started Reference Documentation For further referenc

MaxonBank is a Kotlin + Spring Boot + Axon Framework application that supports opening, depositing to, and withdrawing from accounts.

MaxonBank MaxonBank is a Kotlin + Spring Boot + Axon Framework application that supports opening, depositing to, and withdrawing from accounts. The ap

Grocery - A simple CRUD Project using Spring Boot, Kotlin and MongoDB

Grocery - A simple CRUD Project using Spring Boot, Kotlin and MongoDB

This repository demonstrates how Kotlin can simplify Spring Boot configuration properties file mapping

Kotlin spring-boot nested config props This repository demonstrates how Kotlin can simplify Spring Boot configuration properties file mapping @Constru

Generated with spring boot kotlin starter kit

Kotlin backend Generated with spring boot kotlin starter kit The idea is to: Get a microservice written in kotlin for managing users and roles. To be

Push notification application using One Signal + Spring Boot + Kotlin

Spring Boot push notification system using One Signal This project was created to demonstrate a simple application built with Kotlin + Spring Boot inc

Owner
Felipe Baz
Student of Computer Engineering at ICT - UNIFESP, passionate about computing Machine Learning and computing in general. Python3, C#, .NET core, C, CSS, JS...
Felipe Baz
Ejemplo de API Rest Blog con Spring Boot + Kotlin + Gradle

Blog Ejemplo de API Rest Blog con Spring Boot 2.7.3 + Kotlin + Gradle + Java 17 El objetivo es que pueda servir como guía para el aprendizaje, lo más

Arturo López 6 Dec 18, 2022
Spring-kotlin - Learning API Rest with Kotlin, Spring and PostgreSQL

Kotlin, Spring, PostgreSQL and Liquibase Database Migrations Learning Kotlin for

Andre L S Ferreira 2 Feb 14, 2022
My personal template for a Spring Boot REST reactive webapp

My personal spring boot kotlin reactive template Features Spring Security implementation with JWT access and refresh token MongoDB database Project Co

Dušan 2 Dec 1, 2021
Spring-with-maven - Spring Boot App with Postgresql and maven

Spring Boot Api Aplikasi ini dibuat menggunakan bahasa kotlin dan untuk database

Aldi Aulia Rosyad 1 Jan 12, 2022
Spring-graphql-getting-started - Spring for GraphQL provides support for Spring applications built on GraphQL Java

Getting Started with GraphQL and Spring Boot Spring for GraphQL provides support

Shinya 0 Feb 2, 2022
API for a library using Kotlin, Spring-boot and covered by test

Library API This API is to create Books and be able to borrow from them I'm using: Spring Boot version 2.5.6 Kotlin 1.5.31 Java 11 I'm implementing us

Daniel Queiroz 1 Nov 5, 2021
Simple Todo list API using Spring-Boot, Webflux, Kotlin, Coroutines, & PostgreSQL

Simple Todo list API using Spring-Boot, Webflux, Kotlin, Coroutines, & PostgreSQL

Sami Eljabali 9 Jul 26, 2022
Spring Boot API for Modern Warfare 2 Dedicated Servers

Spring Boot API for Modern Warfare 2 Dedicated Servers

Kai o((>ω< ))o 1 Apr 24, 2022
A sample skeleton backend app built using Spring Boot kotlin, Expedia Kotlin Graphql, Reactive Web that can be deployed to Google App Engine Flexible environmennt

spring-kotlin-gql-gae This is a sample skeleton of a backend app that was built using: Spring Boot(Kotlin) Reactive Web Sprinng Data R2DBC with MYSQL

Dario Mungoi 7 Sep 17, 2022
Spring Boot Example with Kotlin and Domain Driven Design

Spring Boot Kotlin Domain Driven Design Example Just an example project where ddd is implemented with some other great patterns and architecture from

Fernando Guevara Sanchez 16 Jun 29, 2022