How best to pass AdditionalParameters in request?
See original GitHub issueGreat library guys.
I didn’t know where else to ask this, hopefully this is semi-appropriate… I’m trying to send column level custom filter data (date ranges, lookups, etc) back to the server.
I see that IDataTablesRequest
can take an AdditionalParameters
dictionary, but I’m not sure exactly how to structure my object on the client or where to pass it in. ajax.data
perhaps? I’d love to see an example.
Thanks in advance for the help
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Correct way to pass multiple values for same parameter ...
I'm looking into what is the correct way to pass multiple values for the same parameter name in a GET request. I've seen...
Read more >How to Pass Parameters With a GET Request in ASP.NET ...
This article will discuss ways to pass parameters with a GET request in ASP.NET Core, including query params, route params, ...
Read more >A Beginner's Guide to URL Parameters
URL parameters are query strings that provide additional information and data for a given URL.
Read more >How to Pass Multiple Parameters GET Method ASP.NET ...
You have multiple options for passing multiple parameters to a GET method: FromRouteAttribute, FromQuery and Model Binding.
Read more >Best practice for REST API call with many parameters
Best practice is to POST the parameters as an object. This avoids the URL length limit and other problems with query strings.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my aspnet core project, I just did this:
Not the best thing in the world, but damn, I just wanted to get on with building my app.
@danielearrighi Thanks!
That sounds interesting. The only downside I can think of if the multiple
.Where
, which could be replaced by a single (faster compiling/running) statement.I’ll sure give that a try. Maybe provide an automatic binder (with some automatic request parameters parsing) and a manual binder (with override capability to solve complex cases, like nested objects).
I just need to test, however, on
POST
. Dunno for sure right now but in some cases, after parsing body element, you cannot read values again. I have to double check that on all AspNet Core, MVC and WebApi to make sure that parsing parameters automatically won’t break the main request params binding (eg: draw, columns, etc).