lundi 2 juillet 2018

Trying to execute multiple CURL calls with C#

Hello I am having an issue with a program I am trying to create. I need to be able to execute multiple (5 total) CURL calls using C#. Right now I have read many different answers on here, and some answers on other forums and I am very confused.

I am using one 'asnyc static' method with HttpClient that will execute all the calls perfectly (I also need to store a cookie from the first call to use for all the rest) when I set it to void. The issue is I need to return a string when to denote if all the calls executed successfully or not. When I change the function from void to Task it will only execute the first call and then the program stops executing. I have tried to switch to having one function per CURL call, however I still have the same issue.

I have very little experience with asynchronous programming, but I feel like that is where my issue lies. I cannot seem to find an solution that makes sense, so I'm hoping somebody can assist me.

TL;DR : I am trying to execute 5 CURL calls and my program stops after executing the first one.




Aucun commentaire:

Enregistrer un commentaire