Skip to content

Files

Latest commit

 

History

History

9.4.microservice-communication-using-feign

Interservice communication using RestTemplate

Eureka: http://localhost:8010/

Screenshot 2022-07-08 at 5 58 01 PM

Create User

curl --location --request POST 'http://localhost:8011/users-ws/users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstName": "Prateek1",
    "lastName": "Ashtikar1",
    "password": "12345678",
    "email": "prateek.ashtikar1@gmail.com"
}'

Screenshot 2022-07-08 at 6 00 07 PM

Login the User and Generate JWT

curl --location --request POST 'http://localhost:8011/users-ws/users/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "prateek.ashtikar1@gmail.com",
    "password" : "12345678"
}'

Screenshot 2022-07-08 at 6 00 57 PM

Copy UserId: 0a55a956-130a-4f23-828e-5f450f6af75c and use this UserId to make the pass

curl --location --request GET 'http://localhost:8011/users-ws/users/0a55a956-130a-4f23-828e-5f450f6af75c' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIwYTU1YTk1Ni0xMzBhLTRmMjMtODI4ZS01ZjQ1MGY2YWY3NWMiLCJleHAiOjE2NTgxNDY2NjF9.4TyVDXboPnGjDU761ZyVwl0x9v8NqgMgHUwEPeqcL7ZQJSVjDAqJzfFpNASInL-US5d2RYn5dJlVRCdbVwBgJQ' \
--header 'Accept: application/json'

Screenshot 2022-07-08 at 6 06 28 PM