Aber Sie müssen den HttpClient verwenden, der vom Blazor-Framework wie hier beschrieben injiziert wird
But you have to use the HttpClient that is injected by the blazor framework as described here
Da es eine REST API ist, benötigt man natürlich nur einen HttpClient und man kann dagegen entwickeln.
Since it is a REST API all you need is a HttpClient and you can develop against it.
Standardmäßig ist HttpClient eine komplette Reimplementierung des gesamten HTTP-Stacks in Mono.
By default, HttpClient is Mono's complete reimplementation of the entire HTTP stack.
Frage Ich habe eine API auf IIS gehostet, die ich über eine Blazor.Net-Client-App mit dem HttpClient aufrufen möchte, wie im Beispiel angegeben.
Question I have an api hosted on IIS that I am trying to call through a Blazor.Net client app with the HttpClient as provided in the example.
Web-API-Dienste mit HttpClient nutzen; Anfragen in verschiedenen Formaten senden und empfangen; Wiederholungslogik handhaben; Content-Verhandlungen implementieren; mit Swagger Uris und Payloads konstruieren; mit AutoRest Clients erstellen
Consume Web API services by using HttpClient; send and receive requests in different formats; handle retry logic; implement content negotiation; use Swagger to construct Uris and payloads; use AutoRest to build clients
Web-API-Dienste mithilfe von HttpClient synchron und asynchron nutzen; Senden und Empfangen von Anfragen in verschiedenen Formaten (JSON/HTML etc.), Anfragebatching
Consume Web API services by using HttpClient synchronously and asynchronously; send and receive requests in different formats (JSON/HTML/etc.); request batching
XHR oder HttpClient für den Abruf von Webdiensten verwenden; entsprechende HTTP-Verbs für REST einrichten; Fortschritt von Datenanforderungen bearbeiten; SOAP/WCF-Dienste verbrauchen; WebSockets für die bidirektionale Kommunikation verwenden
Use XHR or HttpClient to retrieve web services; set appropriate HTTP verb for REST; handle progress of data requests; consume SOAP/WCF services; use WebSockets for bidirectional communication
Sie können diese Ziele mit Funktionen wie WLResourceRequest erreichen oder mit einer eigenen Instanz von HttpClient, falls Sie mehr Flexibilität benötigen.
You can achieve these goals by using functions such as WLClient.invokeProcedure or your own instance of an HttpClient if you need more flexibility.
Um eine Anmeldung auf einer Standard-FormsAuthentication-Website mit dem HttpClient durchzuführen, müssen Sie den CookieContainer festlegen, da Authentifizierungsdaten für Cookies festgelegt werden.
To perform a login in a standard FormsAuthentication website using the HttpClient, you need to set the CookieContainer, because authentication data will be set on cookies.
Contenu potentiellement sensible ou inapproprié
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.