c# make http request
private static readonly HttpClient client = new HttpClient();
var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");
c# make http request
private static readonly HttpClient client = new HttpClient();
var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");
how to POST in c#
using System;
using System.Collections.Specialized;
using System.Net;
namespace API_Console_App
{
class Program
{
static void Main(string[] args)
{
// Declare the API Endpoint URL
string url = "URL_HERE";
// Create a New WebClient
WebClient client = new WebClient();
// Create a New NameValueCollection
NameValueCollection values = new NameValueCollection();
// Add Data to the NameValueCollection
values.Add("data-name", "content");
// Upload the NameValueCollection Values to the URL
client.UploadValues(url, values);
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us