src/models/microservices.rb
def post_to_url(conn, key, body)
    res = conn.post do | req |
        # req.headers['x-api-key'] = key
        req.body = body.to_json
    end
    JSON.parse(res.body)
  end
# Function for handling post petitions to the microservices
Function for handling post petitions to the microservices
Function for handling post petitions to the microservices
def post_to_url(conn, key, body)
    res = conn.post do | req |
        req.body = body.to_json
    end
    JSON.parse(res.body)
  end
def post_to_url ( conn , key , body ) res = conn . post do | req | req . body = body . to_json end JSON . parse ( res . body ) end
Function for handling post petitions to the microservices
Function for handling post petitions to the microservices
# req.headers['x-api-key'] = key
conn
key
body