Giter VIP home page Giter VIP logo

feign-playground's Introduction

Feign Playground

A playground where OpenFeign-related features are experienced.

  • OpenFeign
    • feign.Headers
    • feign.RequestLine
    • feign.RequestInterceptor
  • Spring Cloud OpenFeign
    • org.springframework.cloud.openfeign.FeignClient
    • org.springframework.cloud.openfeign.FallbackFactory
  • Spring Retry
    • org.springframework.retry.annotation.Retryable
    • org.springframework.retry.annotation.Backoff
    • org.springframework.retry.annotation.Recover
  • Spring Cloud Circuit Breaker
    • org.springframework.cloud.circuitbreaker.resilience4j.Resilience4JCircuitBreakerFactory
  • Resilience4j
    • io.github.resilience4j.retry.annotation.Retry
    • io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker

User

1) List users

GET /users

Example

List users
curl --location --request GET 'http://localhost:8080/users' \
Response
[
  {
    "id": "1",
    "firstName": "Terry",
    "lastName": "Medhurst",
    "age": 50,
    "username": "atuny0",
    "password": "9uQFF1Lh"
  },
  {
    "id": "2",
    "firstName": "Sheldon",
    "lastName": "Quigley",
    "age": 28,
    "username": "hbingley1",
    "password": "CQutx25i8r"
  }
]

Auth

1) Login

GET /auth/login

Request body (required)

Parameter Description Type
username Username received from the /auth/login String
password Password received from the /auth/login String

Post

1) List posts

GET /posts

Example

List posts
curl --location --request GET 'http://localhost:8080/posts' \
Response
[
  {
    "id": 1,
    "title": "His mother had always taught him",
    "body": "His mother had always taught him not to ever think of himself as better than others. He'd tried to live by this motto. He never looked down on those who were less fortunate or who had less money than him. But the stupidity of the group of people he was talking to made him change his mind.",
    "userId": 9,
    "tags": [
      "history",
      "american",
      "crime"
    ],
    "reactions": 2
  },
  {
    "id": 2,
    "title": "He was an expert but not in a discipline",
    "body": "He was an expert but not in a discipline that anyone could fully appreciate. He knew how to hold the cone just right so that the soft server ice-cream fell into it at the precise angle to form a perfect cone each and every time. It had taken years to perfect and he could now do it without even putting any thought behind it.",
    "userId": 13,
    "tags": [
      "french",
      "fiction",
      "english"
    ],
    "reactions": 2
  }
]

2) Create a post

POST /posts

Header (required)

HTTP Header Description
Authorization Token received from /auth/login

Request body (required)

Parameter Description Type
title Title String
userId User ID String
body Body String

Example

Create a post
curl --location --request POST 'http://localhost:8080/posts' \
--header 'Authorization: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title": "Hello world!",
    "userId": "1",
    "body": "Hello world, I'\''m a software engineer!"
}'
Response
{
  "id": 151,
  "title": "Hello world!",
  "body": "Hello world, I'm a software engineer!",
  "userId": 1,
  "tags": null,
  "reactions": 0
}
List posts
curl --location --request GET 'http://localhost:8080/posts' \
Response
{
  "id": 151,
  "title": "Hello world!",
  "body": "Hello world, I'm a software engineer!",
  "userId": 1,
  "tags": null,
  "reactions": 0
}

feign-playground's People

Contributors

emeraldhieu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.