-
-
Save C0D4-101/d430026a70dda82c093260e14cbcbf3e to your computer and use it in GitHub Desktop.
C# Post Rant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = new HttpClient(); | |
var request = new HttpRequestMessage | |
{ | |
Method = HttpMethod.Post, | |
RequestUri = new Uri("https://devrant.com/api/devrant/rants"), | |
Content = new FormUrlEncodedContent(new Dictionary<string, string> | |
{ | |
{ "app", "3" }, | |
{ "rant", "this is a test" }, | |
{ "type", "3" }, | |
{ "token_id", "auth.id" }, | |
{ "token_key", "auth.key" }, | |
{ "user_id", "auth.userid" }, | |
{ "plat", "3" }, | |
{ "tags", "rant" }, | |
}), | |
}; | |
using (var response = await client.SendAsync(request)) | |
{ | |
response.EnsureSuccessStatusCode(); | |
var body = await response.Content.ReadAsStringAsync(); | |
Console.WriteLine(body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment