@@ -306,6 +306,20 @@ public HttpRequestMessage CreateInvokeMethodRequest(string appId, string methodN
306
306
return CreateInvokeMethodRequest ( HttpMethod . Post , appId , methodName ) ;
307
307
}
308
308
309
+ /// <summary>
310
+ /// Creates an <see cref="HttpRequestMessage" /> that can be used to perform service invocation for the
311
+ /// application identified by <paramref name="appId" /> and invokes the method specified by <paramref name="methodName" />
312
+ /// with the <c>POST</c> HTTP method.
313
+ /// </summary>
314
+ /// <param name="appId">The Dapr application id to invoke the method on.</param>
315
+ /// <param name="methodName">The name of the method to invoke.</param>
316
+ /// <param name="queryStringParameters">A collection of key/value pairs to populate the query string from.</param>
317
+ /// <returns>An <see cref="HttpRequestMessage" /> for use with <c>SendInvokeMethodRequestAsync</c>.</returns>
318
+ public HttpRequestMessage CreateInvokeMethodRequest ( string appId , string methodName , IReadOnlyCollection < KeyValuePair < string , string > > queryStringParameters )
319
+ {
320
+ return CreateInvokeMethodRequest ( HttpMethod . Post , appId , methodName , queryStringParameters ) ;
321
+ }
322
+
309
323
/// <summary>
310
324
/// Creates an <see cref="HttpRequestMessage" /> that can be used to perform service invocation for the
311
325
/// application identified by <paramref name="appId" /> and invokes the method specified by <paramref name="methodName" />
@@ -317,6 +331,19 @@ public HttpRequestMessage CreateInvokeMethodRequest(string appId, string methodN
317
331
/// <returns>An <see cref="HttpRequestMessage" /> for use with <c>SendInvokeMethodRequestAsync</c>.</returns>
318
332
public abstract HttpRequestMessage CreateInvokeMethodRequest ( HttpMethod httpMethod , string appId , string methodName ) ;
319
333
334
+ /// <summary>
335
+ /// Creates an <see cref="HttpRequestMessage" /> that can be used to perform service invocation for the
336
+ /// application identified by <paramref name="appId" /> and invokes the method specified by <paramref name="methodName" />
337
+ /// with the HTTP method specified by <paramref name="httpMethod" />.
338
+ /// </summary>
339
+ /// <param name="httpMethod">The <see cref="HttpMethod" /> to use for the invocation request.</param>
340
+ /// <param name="appId">The Dapr application id to invoke the method on.</param>
341
+ /// <param name="methodName">The name of the method to invoke.</param>
342
+ /// <param name="queryStringParameters">A collection of key/value pairs to populate the query string from.</param>
343
+ /// <returns>An <see cref="HttpRequestMessage" /> for use with <c>SendInvokeMethodRequestAsync</c>.</returns>
344
+ public abstract HttpRequestMessage CreateInvokeMethodRequest ( HttpMethod httpMethod , string appId ,
345
+ string methodName , IReadOnlyCollection < KeyValuePair < string , string > > queryStringParameters ) ;
346
+
320
347
/// <summary>
321
348
/// Creates an <see cref="HttpRequestMessage" /> that can be used to perform service invocation for the
322
349
/// application identified by <paramref name="appId" /> and invokes the method specified by <paramref name="methodName" />
@@ -329,9 +356,9 @@ public HttpRequestMessage CreateInvokeMethodRequest(string appId, string methodN
329
356
/// <returns>An <see cref="HttpRequestMessage" /> for use with <c>SendInvokeMethodRequestAsync</c>.</returns>
330
357
public HttpRequestMessage CreateInvokeMethodRequest < TRequest > ( string appId , string methodName , TRequest data )
331
358
{
332
- return CreateInvokeMethodRequest < TRequest > ( HttpMethod . Post , appId , methodName , data ) ;
359
+ return CreateInvokeMethodRequest ( HttpMethod . Post , appId , methodName , new List < KeyValuePair < string , string > > ( ) , data ) ;
333
360
}
334
-
361
+
335
362
/// <summary>
336
363
/// Creates an <see cref="HttpRequestMessage" /> that can be used to perform service invocation for the
337
364
/// application identified by <paramref name="appId" /> and invokes the method specified by <paramref name="methodName" />
@@ -343,9 +370,10 @@ public HttpRequestMessage CreateInvokeMethodRequest<TRequest>(string appId, stri
343
370
/// <param name="appId">The Dapr application id to invoke the method on.</param>
344
371
/// <param name="methodName">The name of the method to invoke.</param>
345
372
/// <param name="data">The data that will be JSON serialized and provided as the request body.</param>
373
+ /// <param name="queryStringParameters">A collection of key/value pairs to populate the query string from.</param>
346
374
/// <returns>An <see cref="HttpRequestMessage" /> for use with <c>SendInvokeMethodRequestAsync</c>.</returns>
347
- public abstract HttpRequestMessage CreateInvokeMethodRequest < TRequest > ( HttpMethod httpMethod , string appId , string methodName , TRequest data ) ;
348
-
375
+ public abstract HttpRequestMessage CreateInvokeMethodRequest < TRequest > ( HttpMethod httpMethod , string appId , string methodName , IReadOnlyCollection < KeyValuePair < string , string > > queryStringParameters , TRequest data ) ;
376
+
349
377
/// <summary>
350
378
/// Perform health-check of Dapr sidecar. Return 'true' if sidecar is healthy. Otherwise 'false'.
351
379
/// CheckHealthAsync handle <see cref="HttpRequestException"/> and will return 'false' if error will occur on transport level
@@ -526,7 +554,7 @@ public Task InvokeMethodAsync<TRequest>(
526
554
TRequest data ,
527
555
CancellationToken cancellationToken = default )
528
556
{
529
- var request = CreateInvokeMethodRequest < TRequest > ( httpMethod , appId , methodName , data ) ;
557
+ var request = CreateInvokeMethodRequest < TRequest > ( httpMethod , appId , methodName , new List < KeyValuePair < string , string > > ( ) , data ) ;
530
558
return InvokeMethodAsync ( request , cancellationToken ) ;
531
559
}
532
560
@@ -620,7 +648,7 @@ public Task<TResponse> InvokeMethodAsync<TRequest, TResponse>(
620
648
TRequest data ,
621
649
CancellationToken cancellationToken = default )
622
650
{
623
- var request = CreateInvokeMethodRequest < TRequest > ( httpMethod , appId , methodName , data ) ;
651
+ var request = CreateInvokeMethodRequest < TRequest > ( httpMethod , appId , methodName , new List < KeyValuePair < string , string > > ( ) , data ) ;
624
652
return InvokeMethodAsync < TResponse > ( request , cancellationToken ) ;
625
653
}
626
654
0 commit comments