UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

58 lines (57 loc) • 1.86 kB
/** * DevExtreme (cjs/__internal/data/odata/request_dispatcher.js) * Version: 26.1.6 * Build date: Fri Oct 16 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("../../../common/data/odata/query_adapter"); var _utils = require("../../../common/data/odata/utils"); const DEFAULT_PROTOCOL_VERSION = 4; class RequestDispatcher { constructor(options) { const dispatcherOptions = options || {}; this._url = String(dispatcherOptions.url).replace(/\/+$/, ""); this._beforeSend = dispatcherOptions.beforeSend; this._jsonp = dispatcherOptions.jsonp; this._version = dispatcherOptions.version || 4; this._withCredentials = dispatcherOptions.withCredentials; this._processDatesAsUtc = dispatcherOptions.processDatesAsUtc ?? dispatcherOptions.deserializeDates ?? false; this._filterToLower = dispatcherOptions.filterToLower } sendRequest(url, method, params, payload) { return (0, _utils.sendRequest)(this.version, { url: url, method: method, params: params ?? {}, payload: payload }, { beforeSend: this._beforeSend, jsonp: this._jsonp, withCredentials: this._withCredentials, processDatesAsUtc: this._processDatesAsUtc }) } get version() { return this._version } get beforeSend() { return this._beforeSend } get url() { return this._url } get jsonp() { return this._jsonp } get filterToLower() { return this._filterToLower } } exports.default = RequestDispatcher;