-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpClient services using AddHttpClient #9553
Conversation
When I tried to use the Syncfusion SfDataManager control, I have found that a little change is required to solve URI exception, but I don't know if this break something else in ABP Framework. If is ok, I will update even the tiered template.
hi @fileman Can you complete the PR? |
@@ -206,9 +206,9 @@ private void ConfigureSwaggerServices(IServiceCollection services) | |||
|
|||
private static void ConfigureHttpClient(ServiceConfigurationContext context) | |||
{ | |||
context.Services.AddTransient(sp => new HttpClient | |||
context.Services.AddHttpClient("abp", sp => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can consider using constant string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, you mean something defined in MyProjectNameConsts like DbTablePrefix or inside Blazor/Blazor.Server, since is required only in this UI version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share the document that explains the AddHttpClient
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tried to use the Syncfusion SfDataManager control, I have found that a little change is required to solve URI exception,
Hi
Does Syncfusion have a document explain it?
Can you share the exception details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any Syncfusion document for this problem, I found the solution myself by following Microsoft's recommendations for httpclient.
I attached sample to reproduce the following exception "System.UriFormatException: 'Invalid URI: The format of the URI could not be determined.'"
SfDataManager.Server.zip
Hi, My scope was different so I hard-coded the |
Yes it's not required for "server" so it can be removed. |
Hi, |
When I tried to use the Syncfusion SfDataManager control, I have found that a little change is required to solve URI exception, but I don't know if this break something else in ABP Framework.
If is ok, I will update even the tiered template.
#8259