Skip to content

[Blazor] HttpClient error when url starts with '/' #9562

@stavroskasidis

Description

@stavroskasidis

Describe the bug

Attempting to make an http call in blazor client-side, using a url that starts with "/", (e.g. "/api/GetValues") results in:
System.ArgumentException: Only 'http' and 'https' schemes are allowed.

To Reproduce

Steps to reproduce the behavior:

  1. Using ASP.NET Core 3.0 preview 4
  2. Create a new blazorhosted project
  3. Go to FetchData.razor and change the url from api/SampleData/WeatherForecasts to /api/SampleData/WeatherForecasts
  4. Run the app and navigate to /fetchdata

Screenshots

image

Metadata

Metadata

Labels

ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions