Skip to main content
Version: 11.14.0

JSON Method Plugin

The JsonMethodPluginService provides methods to call Sinequa JSON plugins via HTTP GET and POST requests.

Methods

post()

Calls a JSON plugin via HTTP POST.

post<U>(method: string, query: U, options?: Options): Observable<any>
NameTypeRequiredDescription
methodstringThe name of the JSON plugin method to call.
queryUParameters to pass to the plugin.
optionsOptionsHTTP request options.

Returns Observable<any> — emits the plugin's response.

Example

example.component.ts
import { inject } from '@angular/core';
import { JsonMethodPluginService } from '@sinequa/atomic-angular';

inject(JsonMethodPluginService).post('myMethod', { param: 'value' }).subscribe(response => {
console.log(response);
});

get()

Calls a JSON plugin via HTTP GET.

get<U extends Record<string, string | boolean | number | Date | object | undefined>>(
method: string,
query: U,
options?: Options
): Observable<any>
NameTypeRequiredDescription
methodstringThe name of the JSON plugin method to call.
queryUParameters to pass to the plugin.
optionsOptionsHTTP request options.

Returns Observable<any> — emits the plugin's response.

Example

example.component.ts
import { inject } from '@angular/core';
import { JsonMethodPluginService } from '@sinequa/atomic-angular';

inject(JsonMethodPluginService).get('myMethod', { param: 'value' }).subscribe(response => {
console.log(response);
});