question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

whitespace between parameters in the request can not match the route template

See original GitHub issue

Describe the bug

Supposed I have the following action in the controller:

[HttpGet("GetProductPrices(organizationId={organizationId},partId={partId})")]
public IActionResult GetPrice(string organizationId, string partId)
{
   // ....
}

The following request works fine:

https://{{url}}/GetProductPrices(organizationId='10001',partId='100000-01')  <-- Working 

The following request can’t work. (Be noted, there’s a whitespace between parameters)

https://{{url}}/GetProductPrice(organizationId='10001', partId='100000-01')  <-- This does not work and gets a 404 Not Found response

I’d like to learn :

  1. GetProductPrices(organizationId={organizationId},partId={partId}) is correct pattern?
  2. A whitespace between parameters is not allowed?
  3. If I put a whitespace between route template, For example, GetProductPrices(organizationId={organizationId}, partId={partId}), we have to match the whitespace in the request URI?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xuzhgcommented, Mar 22, 2021

More suggestion:

Can we support the different order for the function parameter from ASP.NET Core?

https://{{url}}/GetProductPrices(organizationId='10001',partId='100000-01')

&

https://{{url}}/GetProductPrices(partId='100000-01',organizationId='10001')

can both match the GetProductPrices(organizationId={organizationId},partId={partId}) pattern?

0reactions
msftbot[bot]commented, Sep 22, 2021

We’ve moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel Route Parameters Not Trimmed (it normally works ...
This will trim the whitespaces from the front and back but pad the string with #'s so it's still the original length.
Read more >
Configure Azure Front Door rules match conditions
Use the post args match condition to identify requests based on the arguments provided within a POST request's body. A single match condition ......
Read more >
URL Templates | Routing and Navigation | Flow
Route templates define the possibility of including parameters into a route. A route template is a sequence of segments /seg_1/seg_2/…
Read more >
Model Binding in ASP.NET Core
This article explains what model binding is, how it works, and how to customize its behavior. What is Model binding. Controllers and Razor...
Read more >
Why does my shell script choke on whitespace or other ...
First off, if your parameters contain spaces then they need to be quoted going in ( on the command line ). However you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found