How to simply call a method from container1 to container2 in .net core using api like https://localhost:5001/api/Movies/getname

I can create and run 2 containers which are in separate project. both run and work with no issue.

But I want to call a method from one container1 which returns a string like “hey its me from container1” by container2.

I am new to this kind of development. any help would be appreciated.


  • I don’t use compose file yet. actually I tried but didn’t understand how to create network and connect containers them, to each other.many tutorials were checked out but didn’t get how to do it.

  • both containers are in same network

  • I dont use any SQL or any other complicated code just want a method to call a api like ” https://localhost:5001/api/Movies/getname.” and returning the string.

  • the projects are created in .net core(VS 2017).

  • A problem I am facing is when I add composer file to prj can not debug the project it self.

Source: StackOverflow