UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

58 lines (57 loc) 1.78 kB
/** * DevExtreme (cjs/__internal/data/odata/m_request_dispatcher.js) * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 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) { options = options || {}; this._url = String(options.url).replace(/\/+$/, ""); this._beforeSend = options.beforeSend; this._jsonp = options.jsonp; this._version = options.version || 4; this._withCredentials = options.withCredentials; this._deserializeDates = options.deserializeDates; this._filterToLower = options.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, deserializeDates: this._deserializeDates }) } 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;