Would someone know to convert this request from Curl to C #?

acejack15acejack15 ✭✭Member ✭✭
edited April 2018 in Xamarin.Forms

hello friends, I have to use a server but the server only gives me the documentation to make Curl requests and not work with that someone would know how to convert the Curl application to C # or could guide me how to use Curl in my app thank you very much below I leave the Curl application
curl -F "message={\"command\":\"detect\",\"task-id\":\"1234-5678\",\"description\":\"this is a test task\"}" -F "filecomment=This is an image file" -F "[email protected]" 108.161.128.85:8888/app -u "rjtzWc674hDxTSWulgETRqHrVVQoI3T8f9RoMlO6zsQ:test"

Answers

  • JamesLaveryJamesLavery ✭✭✭✭✭ GBBeta, University ✭✭✭✭✭
    It looks like you want to communicate with a server service passing JSON. That's the question you need to post.

    There are plenty of resources available detailing how to implement a service client. One thing we need to know is the type of service which the server is running (WCF, Web API etc)
  • acejack15acejack15 ✭✭ Member ✭✭

    hi friend exactly that is the answer with a json, what happens that the documentation is almost null but I'm almost sure it is a web API could you help me with this information?

  • AdamMeaneyAdamMeaney ✭✭✭✭✭ USMember ✭✭✭✭✭

    https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client

    Decent starter idea. You want to use an HttpClient, either the build in like I just sent or a good wrapper api. My coworkers recommend Flurl as a good one if you don't like the usual HttpClient.

Sign In or Register to comment.