Skip to content

Repository with a basic REST API gRPC Client consuming a gRPC Server

License

Notifications You must be signed in to change notification settings

gabrielleandro0801/python-grpc-rest-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poc-grpc-python-api-rest-consumer

A simple API Rest to insert a user in database and consume a gRPC Server to get data from the zipCode.

POST /v1/users

Request Body

{
    "document": "00011122233",
    "name": "Gabriel",
    "zipCode": "01234560",
    "number": "01"
}

Response - 201

{
    "message": "User successfully saved",
    "document": "00011122233",
    "name": "Gabriel",
    "cep": "01234560",
    "city": "City Name",
    "neighborhood": "Neighborhood Name",
    "street": "Street Name",
    "number": "01"
}

Flow

  1. The API receives a request and requests to the gRPC Server with the zipCode to get data of the address.
  2. The Server requests to Viacep API and returns to the client.
  3. The client receives the response and saves the item in database and returns the response to the client.

About

Repository with a basic REST API gRPC Client consuming a gRPC Server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages