none
How to write POC in C# that can collect an image file from a specified folder on disk and upload it to the API,

    Question

  • How to write POC in C# that can collect an image file from a specified folder on disk and upload it to the API, wait for a response. The response can be saved to disk as a json file. The file being upload must be a jpeg file.

    Below is my coding

     using (var wb = new WebClient())
                {
                    var data = new NameValueCollection();
                    data["File"] = "Fresh-Full-Cream-Ayrshire-Milk-3L-6001009001733";

                    var response = wb.UploadValues("https://damsense.appspot.com/post", "POST", data);
                    Console.WriteLine(response);
                    Console.Read();
                }

                   
                }

    Friday, May 24, 2019 9:22 AM

All replies

  • Hi MARIBA,

    Thank for posting here.

    For your question, I want to know what POC is. Besides, could you tell me what happened about the above code, such as something exception or is not working?

    We are waiting for your update.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 27, 2019 1:56 AM