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

  • Thread starter Thread starter MARIBA
  • Start date Start date
M

MARIBA

Guest
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();
}


}

Continue reading...
 
Back
Top