Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# post get request

using System.Net.Http;

HttpClient client = new HttpClient();
/// POST ///

var values = new Dictionary<string, string>
{
    { "thing1", "hello" },
    { "thing2", "world" }
};

var content = new FormUrlEncodedContent(values);

var response = await client.PostAsync("http://www.example.com/recepticle.aspx", content);

var responseString = await response.Content.ReadAsStringAsync();

/// GET ///

var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");
Comment

PREVIOUS NEXT
Code Example
Csharp :: get all files in all subdirectories c# 
Csharp :: swagger authentication bearer .net core 
Csharp :: c# round number down 
Csharp :: how to change the extension of a file C# 
Csharp :: move file c# 
Csharp :: unity movetowards 2d 
Csharp :: how to do a web request unity 
Csharp :: c# counting lines 
Csharp :: get values from range entity framework 
Csharp :: unity projectile spread 
Csharp :: c sharp gun shooting 
Csharp :: unity ui change sprite 
Csharp :: unity know when mouse on ui 
Csharp :: mvc select list order by 
Csharp :: read configuration workerservice 
Csharp :: discord bot time C# 
Csharp :: c# date to string yyyy-mm-dd 
Csharp :: winforms messagebox with button 
Csharp :: snx disconnect linux 
Csharp :: unity length of string 
Csharp :: c# datatable copy selected rows to another table 
Csharp :: how to make a object disapear in windows form c# 
Csharp :: get web config key value in c# razor view 
Csharp :: game object find 
Csharp :: how to store user input into list c# 
Csharp :: unity knowing when 0 input is pressed 
Csharp :: C# int.parse input string wasnt in correct format 
Csharp :: c# create instance from type 
Csharp :: c# solution path 
Csharp :: c# datagridview change column name 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =