Update 20211218
This commit is contained in:
30
DPMHttp/Class1.cs
Normal file
30
DPMHttp/Class1.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
Imports System
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Linq
|
||||
Imports System.Text
|
||||
Imports System.Threading.Tasks
|
||||
Imports System.Net.Http
|
||||
Imports System.Net.Http.Headers
|
||||
|
||||
Namespace HttpClientDemo
|
||||
Class Program
|
||||
Private Shared Sub Main(ByVal args As String())
|
||||
Dim student = New Student() With
|
||||
{
|
||||
.Name = "Steve"
|
||||
}
|
||||
Dim postTask = client.PostAsJsonAsync(Of Student)("student", student)
|
||||
postTask.Wait()
|
||||
Dim result = postTask.Result
|
||||
|
||||
If result.IsSuccessStatusCode Then
|
||||
Dim readTask = result.Content.ReadAsAsync(Of Student)()
|
||||
readTask.Wait()
|
||||
Dim insertedStudent = readTask.Result
|
||||
Console.WriteLine("Student {0} inserted with id: {1}", insertedStudent.Name, insertedStudent.Id)
|
||||
Else
|
||||
Console.WriteLine(result.StatusCode)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
49
DPMHttp/DPMHttp.csproj
Normal file
49
DPMHttp/DPMHttp.csproj
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DAB22BC0-2307-43E4-BD58-BA5ABA1889A9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DPMHttp</RootNamespace>
|
||||
<AssemblyName>DPMHttp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
DPMHttp/Properties/AssemblyInfo.cs
Normal file
36
DPMHttp/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("DPMHttp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DPMHttp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("dab22bc0-2307-43e4-bd58-ba5aba1889a9")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// indem Sie "*" wie unten gezeigt eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
|
||||
BIN
DPMHttp/obj/Debug/DPMHttp.csproj.AssemblyReference.cache
Normal file
BIN
DPMHttp/obj/Debug/DPMHttp.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
1
DPMHttp/obj/Debug/DPMHttp.csproj.CoreCompileInputs.cache
Normal file
1
DPMHttp/obj/Debug/DPMHttp.csproj.CoreCompileInputs.cache
Normal file
@@ -0,0 +1 @@
|
||||
a2298045b900f41848de7aafd653543cabda22d0
|
||||
2
DPMHttp/obj/Debug/DPMHttp.csproj.FileListAbsolute.txt
Normal file
2
DPMHttp/obj/Debug/DPMHttp.csproj.FileListAbsolute.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
E:\Software-Projekte\DPM\DPM2016\DPMHttp\obj\Debug\DPMHttp.csproj.AssemblyReference.cache
|
||||
E:\Software-Projekte\DPM\DPM2016\DPMHttp\obj\Debug\DPMHttp.csproj.CoreCompileInputs.cache
|
||||
BIN
DPMHttp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
BIN
DPMHttp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
Binary file not shown.
Reference in New Issue
Block a user