Installing & Making a Request
Please download this entire unirest-net library and reference it in your project.
Task<HttpResponse<MyClass>> response = Unirest.post(API_URL)
.header("X-RapidAPI-Key", API_KEY)
.header("Content-Type", "application/x-www-form-urlencoded")
.asJson();
Asynchronous Requests
Task<HttpResponse<MyClass>> myClassTask = Unirest.post(API_URL)
.header("X-RapidAPI-Key", API_KEY)
.header("Content-Type", "application/x-www-form-urlencoded")
.asJsonAsync<MyClass>();
File Uploads
Task<HttpResponse<MyClass>> response = Unirest.post(API_URL)
.header("X-RapidAPI-Key", API_KEY)
.header("Content-Type", "application/x-www-form-urlencoded")
.field("content", File.ReadAllBytes(@"/path/to/file"))
.asJson();
Updated 11 months ago