locked
dot net core url routing not working for french character on hosted server RRS feed

  • Question

  • User-725552375 posted

    Hi Team,

    can you please guide how to allow french character in routing, 

    when I try to fetch user data with french username my API is not working in hosted server, but it is working in local

    GetUserProfileByusername/dplêw

    c# code i am using for routing

    public void ConfigureServices(IServiceCollection services)
    {
    services.AddMvc();
    }


    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {

    app.UseMvc();


    }

    [Route("Api/[action]")]
    [Route("{username}")]
    [HttpGet]
    public async Task<IActionResult> GetUserProfileByUserName(string username)
    {

    return Ok(Info);
    }

    Error code it return - 

    <div id="content">
    <div class="content-container">
    <fieldset>
    <h2>404 - File or directory not found.</h2>
    <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
    </fieldset>
    </div>
    </div>

    Friday, October 26, 2018 8:09 PM

All replies

  • User1724605321 posted

    Hi pritkumar08 ,

    when I try to fetch user data with french username my API is not working in hosted server, but it is working in local

    Please confirm the runtime version/.net core SDK are same on hosted server , or you can provide code sample/provide detail steps to help us reproduce your issue .

    Best Regards,

    Nan Yu

    Monday, October 29, 2018 7:32 AM