0
krashhh created
Hi,
I want to use Dynamic API Client Proxy, but I need an option to change the base URL in runtime before specific service API call.
public class MyService : ITransientDependency
{
private readonly IHttpClientProxy<IBookAppService> _bookService;
public MyService(IHttpClientProxy<IBookAppService> bookHttpClientProxy)
{
_bookHttpClientProxy = bookHttpClientProxy;
}
public async Task DoIt()
{
** _bookHttpClientProxy.BaseURL = "xyz"; // Something like this.**
var books = await _bookHttpClientProxy.Service.GetListAsync();
foreach (var book in books)
{
Console.WriteLine($"[BOOK {book.Id}] Name={book.Name}");
}
}
}
Please help me how I can extend something to achieve this functionality?
1 Answer(s)
-
0
hi
You can change the
AbpRemoteServiceOptions
. And useAddAbpDynamicOptions<AbpRemoteServiceOptions>
https://github.com/abpframework/abp/pull/6332