I’m currently facing an issue while attempting to make an HTTP POST request from a Motoko canister to MongoDB Atlas using the Data API. It’s worth noting that when I perform the same HTTP POST request using Postman, it works perfectly fine. However, I encounter errors when making the request within my Motoko canister.
Here are the details of the errors I’m experiencing:
Local Environment Error:
Call was rejected: Request ID: 30319254c0033871ef4cefbd0df07870cf8bb91388ef2c3d5199b14f68def3c2 Reject code: 4 Reject text: Connecting to ap-south-1.aws.data.mongodb-api.com failed: Request through socks proxy failed: error trying to connect: dns error: failed to lookup address information: nodename nor servname provided, or not known
Mainnet Deployment Error:
Call was rejected: Request ID: 83c70d5e80c999f15a5bb635e5b62b214b401e8d29ee3d4676be3da1cbff0b36 Reject code: 4 Reject text: Connecting to ap-south-1.aws.data.mongodb-api.com failed: Request failed: error trying to connect: tcp connect error: Network is unreachable (os error 101)
I’m seeking assistance from the community to understand the root causes behind these errors and explore potential solutions. Given that the same request works in Postman.
Any insights or guidance on resolving this issue would be greatly appreciated. Thank you in advance for your help!