当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Connection.send方法代码示例

本文整理汇总了TypeScript中@hpcc-js/comms.Connection.send方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Connection.send方法的具体用法?TypeScript Connection.send怎么用?TypeScript Connection.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@hpcc-js/comms.Connection的用法示例。


在下文中一共展示了Connection.send方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: _send

    _send(service, action, _params) {
        var params = lang.mixin({
            request: {},
            load: function (response) {
            },
            error: function (error) {
            },
            event: function (evt) {
            }
        }, _params);
        lang.mixin(params.request, {
            rawxml_: true
        });

        var handleAs = params.handleAs ? params.handleAs : "json";
        var postfix = "";
        if (handleAs === "json") {
            postfix = ".json";
        }
        // var method = params.method ? params.method : "get";

        var retVal = null;
        if (this.isCrossSite()) {
            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), type: "jsonp" });
            retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
        } else {
            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service) });
            retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
        }

        return retVal.then(function (response) {
            if (lang.exists("Exceptions.Exception", response)) {
                if (response.Exceptions.Exception.Code === "401") {
                    if (cookie("Status") === "Unlocked") {
                        topic.publish("hpcc/session_management_status", {
                            status: "DoIdle"
                        });
                    }
                    cookie("Status", "Locked");
                    ESPUtil.LocalStorage.removeItem("Status");
                }
            }
            params.load(response);
            return response;
        }).catch(function (error) {
            params.error(error);
            return error;
        });
    }
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:49,代码来源:ESPRequest.ts

示例2: it

 it("JSONP", function () {
     if (!isTravis() && isBrowser()) {
         const transport = new Connection({ baseUrl: "http://10.241.100.159:800./wsEcl/submit/query/roxie", type: RequestType.JSONP });
         const request = {
             bestfitmax: 1,
             Date1: "19900613",
             Address1: "1740 Maryland Ave",
             City1: "Charlotte",
             State1: "NC",
             Zip1: "28209",
             Zip1LowYYYYMM: "199002",
             Zip1HighYYYYMM: "199101",
             Date2: "19910829",
             Address2: "1512 Turnstone Ct",
             City2: "Rock Hill",
             State2: "SC",
             Zip2: "29732",
             Zip2LowYYYYMM: "199104",
             Zip2HighYYYYMM: "199204",
             Date3: "19990109",
             Address3: "6147 Garamond Ct",
             City3: "Charlotte",
             State3: "NC",
             Zip3: "28270",
             Zip3LowYYYYMM: "199809",
             Zip3HighYYYYMM: "199908",
             GeoDistanceThreshold: "5",
             demomode: true
         };
         return transport.send("wecares.serialoffenderfinderservice/json", request).then((response) => {
             expect(response).exist;
         });
     }
 });
开发者ID:jchambers-ln,项目名称:Visualization,代码行数:34,代码来源:connection.spec.ts

示例3: _send

    _send(service, action, _params) {
        var params = lang.mixin({
            request: {},
            load: function (response) {
            },
            error: function (error) {
            },
            event: function (evt) {
            }
        }, _params);
        lang.mixin(params.request, {
            rawxml_: true
        });

        var handleAs = params.handleAs ? params.handleAs : "json";
        var postfix = "";
        if (handleAs === "json") {
            postfix = ".json";
        }
        // var method = params.method ? params.method : "get";

        if (this.isLocked()) {
            throw new Error("session locked");
        }

        var retVal = null;
        if (this.isCrossSite()) {
            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), type: "jsonp" });
            retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
        } else {
            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service) });
            retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
        }

        return retVal.then(function (response) {
            params.load(response);
            return response;
        }).catch(function (error) {
            params.error(error);
            return error;
        });
    }
开发者ID:GordonSmith,项目名称:HPCC-Platform,代码行数:42,代码来源:ESPRequest.ts

示例4: it

 it("port 8010", function () {
     const transport = new Connection({
         baseUrl: "http://play.hpccsystems.com:8010/",
         userID: "gosmith",
         password: "",
         type: "post"
     });
     return transport.send("WsWorkunits/WUQuery.json", {}).then(function (response) {
         expect(true).to.be.true;
         return response;
     }).catch(function (e) {
         expect(false).to.be.true;
     });
 });
开发者ID:GordonSmith,项目名称:Visualization,代码行数:14,代码来源:connection.spec.ts


注:本文中的@hpcc-js/comms.Connection.send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。