Skip to content

Cannot access request argument with HTTP protocol on GET route #713

@Aschen

Description

@Aschen

Description

index, collection and other arguments are not present in request input while using the HTTP protocol of the SDK.

I suspect the URL to be incorrectly created by the SDK Http protocol since the generated route is GET

Backend

app.controller.register("efficient", {
  actions: {
    "efficient": {
      handler: async (request: KuzzleRequest) => {
console.log(request.input.args);
if (request.input.args.index === undefined) {
  throw new Error('No index');
}
      }
    }
  }
})

Client (SDK)

import { Kuzzle, Http } from 'kuzzle-sdk';

const kuzzle = new Kuzzle(new Http('localhost'));

await kuzzle.query({
    controller: 'efficient',
    action: 'efficient',
    index: "index",
    collection: "collection",
    body: { hey: "hey" },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions