Protocol Plugin - Jsonp
!Executes only in browser, on server this plugin is noop.
Makes jsonp request.
Uses fetch-jsonp
library.
Parameters
Create options
Options are passed to fetch-jsonp
on every request.
Request params
url
: string - url to requestquery
: object - query parameters of the requestqueryNoCache
: object - same asquery
but value wont be used when generating cache keyjsonp
: object - configuration passed forfetch-jsonp
, this value is merge with created options and get passed for every request
Example
import request from '@tinkoff/request-core';
import jsonp from '@tinkoff/request-plugin-protocol-jsonp';
const req = request([
// ... other plugins
// should be set last as this plugin makes actual reqest
jsonp(),
]);