public async Task <IActionResult> App2Get([FromServices] DaprClient daprClient) { var ext = new Dapr.Client.Http.HTTPExtension() { Verb = Dapr.Client.Http.HTTPVerb.Get, }; var status = await daprClient.InvokeMethodAsync <object>("app2", "health", ext); return(Ok(status)); }
/// <summary> /// Invokes a method on a Dapr app. /// </summary> /// <typeparam name="TRequest">The type of data to send.</typeparam> /// <param name="appId">The Dapr application id to invoke the method on.</param> /// <param name="methodName">The name of the method to invoke.</param> /// <param name="data">Data to pass to the method</param> /// <param name="httpExtension">Additional fields that may be needed if the receiving app is listening on HTTP.</param> /// <param name="cancellationToken">A <see cref="CancellationToken" /> that can be used to cancel the operation.</param> /// <returns>A <see cref="ValueTask{T}" /> that will return the value when the operation has completed.</returns> public abstract Task InvokeMethodAsync <TRequest>( string appId, string methodName, TRequest data, Dapr.Client.Http.HTTPExtension httpExtension = default, CancellationToken cancellationToken = default);
/// <summary> /// Invokes a method on a Dapr app. /// </summary> /// <param name="appId">The Dapr application id to invoke the method on.</param> /// <param name="methodName">The name of the method to invoke.</param> /// <param name="data">Byte array to pass to the method</param> /// <param name="httpExtension">Additional fields that may be needed if the receiving app is listening on HTTP.</param> /// <param name="cancellationToken">A <see cref="CancellationToken" /> that can be used to cancel the operation.</param> /// <returns>A <see cref="ValueTask{T}" /> that will return the value when the operation has completed.</returns> public abstract Task <InvocationResponse <byte[]> > InvokeMethodRawAsync( string appId, string methodName, byte[] data, Dapr.Client.Http.HTTPExtension httpExtension = default, CancellationToken cancellationToken = default);
/// <summary> /// Invokes a method on a Dapr app. /// </summary> /// <param name="appId">The Dapr application id to invoke the method on.</param> /// <param name="methodName">The name of the method to invoke.</param> /// <param name="data">Data to pass to the method</param> /// <param name="httpExtension">Additional fields that may be needed if the receiving app is listening on HTTP.</param> /// <param name="cancellationToken">A <see cref="CancellationToken" /> that can be used to cancel the operation.</param> /// <returns>A <see cref="Task{InvokeResponse}" /> that will return the value when the operation has completed.</returns> public abstract Task <InvocationResponse <TResponse> > InvokeMethodWithResponseAsync <TRequest, TResponse>( string appId, string methodName, TRequest data, Dapr.Client.Http.HTTPExtension httpExtension = default, CancellationToken cancellationToken = default);
/// <summary> /// Invokes a method on a Dapr app. /// </summary> /// <typeparam name="TResponse">The type of the object in the response.</typeparam> /// <param name="appId">The Dapr application id to invoke the method on.</param> /// <param name="methodName">The name of the method to invoke.</param> /// <param name="httpExtension">Additional fields that may be needed if the receiving app is listening on HTTP.</param> /// <param name="cancellationToken">A <see cref="CancellationToken" /> that can be used to cancel the operation.</param> /// <returns>A <see cref="ValueTask{T}" /> that will return the value when the operation has completed.</returns> public abstract ValueTask <TResponse> InvokeMethodAsync <TResponse>( string appId, string methodName, Dapr.Client.Http.HTTPExtension httpExtension = default, CancellationToken cancellationToken = default);