1

I have a nodejs server setup on AWS with mongoDB. I want to access the database contents using GET method. There is another application in python which needs to access this database present on AWS. I searched on the internet and came across PycURL but I am not getting how to use it exactly. How to approach with pycURL or what can be an alternate solution?

2 Answers 2

0

You can build your restful API that is going to handle those GET requests. You have awesome tutorial (with example that you want on bottom):

https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4


Edit: If you want phyton code for GET requests there is awesome answer here: Simple URL GET/POST function in Python


Edit 2: Example of how would this work. You first need to code your API how to handle GET request and on what route (example: http://localhost:5000/api/getUsers). Than you want to make GET request to that route using Phyton: Example:

r = requests.get(url="http://localhost:5000/api/getUsers")
Sign up to request clarification or add additional context in comments.

2 Comments

Actually our server is working. we have another application having python scripts and that application needs accessing the database. So how do i acess the database from that application (code in python)
@TanayNarkhede You have awesome answer written in phyton here: stackoverflow.com/questions/4476373/…
0

I had a similar problem a while ago, there is a tutorial here here. It can lead you towards your intended direction, the drawback may be that in the tutorial, to issue the http request (if I remember correctly), they used postman but I'm sure you can still use PyCurl.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.