0

I have to automate simple curl on API with lambda (with digest Authentification), but I find really difficult to it :

Can't I use simple fetch or do I have to use specific module ? Why should I use a specific module ? Where are the resources ? I find really hard to get a real documentation on fetch API with nodejs.

lemonpear
  • 58
  • 5
  • Hi lemonpear, welcome to Stackoverflow. Can you please be more specific what you are trying to do? Doing a "simple curl" is not really telling us much. Are you trying to download a file? Are you trying to send a GET/POST/PUT request to some REST API? Can you post the relevant parts of your Lambdas code? – Jens Dec 14 '20 at 13:53
  • For exemple, I can send a GET request with curl to MongDB Cloud (atlas) to ask about all the clusters/collections present: curl --user "user:password" --digest --include \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/{projectID/clusters/{SourceName}/backup/restoreJobs" \ --data '{"snapshotId" : "{SNAPSHOT-ID}","deliveryType" : "automated","targetClusterName" : "{clusterID}","GroupID" : "TargetID"}' but I have to convert this "shell" type to a nodejs for AWS lambda with digest authentification – lemonpear Dec 14 '20 at 17:08
  • Does this answer your question: https://stackoverflow.com/questions/17110783/how-to-do-request-http-digest-auth-with-node-js – Jens Dec 14 '20 at 17:31

0 Answers0