0

I have set up a backend server with multiple endpoints using NodeJS with the ExpressJS framework. These REST Api Endpoints are connected to a Mongodb Database.

Due to project requirements, I had to write some code on C# that will also be calling and posting data into the database. However, I am now having trouble accessing the collections created by the ExpressJS Api Endpoint on my C# code.

May I know how is it normally done? Eg. how do I create a GET request from C# to access a collection created by ExpressJS Any help is greatly appreciated! Thank you!

1 Answers1

0

I am not sure what you are really looking for...
But for that you will need your express server running/online, so you may consume the api you have set it up.
And for C# part, you will need to do something that C# will hit/consume the endpoints from express server.

I think this links will be very helpful, I hope to be of a help for you.
How do I make calls to a REST api using C#?

https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client#send-a-get-request-to-retrieve-a-resource

Erni Souza
  • 260
  • 1
  • 6