-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Ajax call to 'api/queries/{name}' fails #5533
Comments
JSON.stringify({ from: 0, size: 8 }) |
Hi Skrypt, |
Hasn't anyone faced this issue? I guess requesting query result via ajax is a widespread scenario. |
Hello everyone, I've figured out, that current implementation only allows querying results with GET, like var products = $.getJSON( "api/queries/ProductList?parameters={from:0,size:8}"); I'm really confused at this moment as I've never seen passing objects into GET query.
So my assumptions were:
|
For instance GraphQL supports GETs too, like this. It would be ok to support POST though and read the parameters from the body (like GraphQL does it too) |
…uests. (OrchardCMS#13853) Co-authored-by: emrah.tokalak <[email protected]> Co-authored-by: Sébastien Ros <[email protected]>
Hello everyone,
I'm currently trying to receive query results using an AJAX call:
but it fails with "System.InvalidCastException: Null object cannot be converted to a value type."
This happens because
Task<IActionResult> Query( string name, string parameters)
always getparameters
equals tonull
and instantiate an emptyDictionary
.LuceneQueryService
tries to get the value at thevar size = sizeProperty?.Value<int>() ?? 50;
line and fails.All the required permissions for Queries are granted.
Could someone point me on what I'm doing wrong, please?
The text was updated successfully, but these errors were encountered: