初始化
This commit is contained in:
14
ConsoleApp1/ConsoleApp1.csproj
Normal file
14
ConsoleApp1/ConsoleApp1.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="RestSharp" Version="112.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
23
ConsoleApp1/Program.cs
Normal file
23
ConsoleApp1/Program.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using RestSharp;
|
||||
using System;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string BaseUrl = "http://localhost:51445/";
|
||||
string Url = "api/values/get_json";
|
||||
var options = new RestClientOptions(BaseUrl);
|
||||
var client = new RestClient(options);
|
||||
var request = new RestRequest(Url);
|
||||
request.AddQueryParameter("data", "{\"2222\":\"4444\"}");
|
||||
|
||||
var response= client.ExecuteGet(request);
|
||||
var qqq= response.Content;
|
||||
|
||||
Console.WriteLine("Hello, World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user