-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.rs
More file actions
34 lines (21 loc) · 800 Bytes
/
backup.rs
File metadata and controls
34 lines (21 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
namespace app
{
class App {
static HttpClient client = new HttpClient();
public static async Task makeRequest(){
var request = new MultipartFormDataContent();
var image_data = File.OpenRead("image.jpg");
request.Add(new StreamContent(image_data),"image",Path.GetFileName("image.jpg"));
var output = await client.PostAsync("http://localhost:80/v1/vision/scene",request);
var jsonString = await output.Content.ReadAsStringAsync();
Console.WriteLine(jsonString);
}
static void Main(string[] args){
makeRequest().Wait();
}
}
}