How to use the xhr.FormData function in xhr

To help you get started, we’ve selected a few xhr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bradyhouse / house / fiddles / nativeScript / fiddle-0001-PageNavigation / pagenavigation / platforms / android / build / intermediates / assets / F0 / debug / app / tns_modules / fetch / fetch.js View on Github external
(function () {
    'use strict';

    exports.XMLHttpRequest = global.XMLHttpRequest;
    exports.FormData = global.FormData;

    if (!exports.XMLHttpRequest) {
        var xhr = require("xhr");
        exports.XMLHttpRequest = xhr.XMLHttpRequest;
        exports.FormData = xhr.FormData;
    }

    function normalizeName(name) {
        if (typeof name !== 'string') {
            name = name.toString();
        }
        if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
            throw new TypeError('Invalid character in header field name')
        }
        return name.toLowerCase()
    }

    function normalizeValue(value) {
        if (typeof value !== 'string') {
            value = value.toString();
        }
github NickIliev / NativeScript-Firebase-Auth / firebaseAuth / platforms / android / build / intermediates / assets / F0F1 / debug / app / tns_modules / fetch / fetch.js View on Github external
(function () {
    'use strict';

    exports.XMLHttpRequest = global.XMLHttpRequest;
    exports.FormData = global.FormData;

    if (!exports.XMLHttpRequest) {
        var xhr = require("xhr");
        exports.XMLHttpRequest = xhr.XMLHttpRequest;
        exports.FormData = xhr.FormData;
    }

    function normalizeName(name) {
        if (typeof name !== 'string') {
            name = name.toString();
        }
        if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
            throw new TypeError('Invalid character in header field name')
        }
        return name.toLowerCase()
    }

    function normalizeValue(value) {
        if (typeof value !== 'string') {
            value = value.toString();
        }
github NativeScript / NativeScript / fetch / fetch.js View on Github external
(function () {
    'use strict';

    exports.XMLHttpRequest = global.XMLHttpRequest;
    exports.FormData = global.FormData;

    if (!exports.XMLHttpRequest) {
        var xhr = require("xhr");
        exports.XMLHttpRequest = xhr.XMLHttpRequest;
        exports.FormData = xhr.FormData;
    }

    function normalizeName(name) {
        if (typeof name !== 'string') {
            name = name.toString();
        }
        if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
            throw new TypeError('Invalid character in header field name')
        }
        return name.toLowerCase()
    }

    function normalizeValue(value) {
        if (typeof value !== 'string') {
            value = value.toString();
        }
github NickIliev / NativeScript-Firebase-Auth / firebaseAuth / platforms / android / build / intermediates / assets / F0F1 / debug / app / tns_modules / globals / globals.js View on Github external
configurable: true
    });
}
if (global.__snapshot) {
    var timer = require("timer");
    global.setTimeout = timer.setTimeout;
    global.clearTimeout = timer.clearTimeout;
    global.setInterval = timer.setInterval;
    global.clearInterval = timer.clearInterval;
    var dialogs = require("ui/dialogs");
    global.alert = dialogs.alert;
    global.confirm = dialogs.confirm;
    global.prompt = dialogs.prompt;
    var xhr = require("xhr");
    global.XMLHttpRequest = xhr.XMLHttpRequest;
    global.FormData = xhr.FormData;
    var fetch = require("fetch");
    global.fetch = fetch.fetch;
    global.Headers = fetch.Headers;
    global.Request = fetch.Request;
    global.Response = fetch.Response;
}
else {
    registerOnGlobalContext("setTimeout", "timer");
    registerOnGlobalContext("clearTimeout", "timer");
    registerOnGlobalContext("setInterval", "timer");
    registerOnGlobalContext("clearInterval", "timer");
    registerOnGlobalContext("alert", "ui/dialogs");
    registerOnGlobalContext("confirm", "ui/dialogs");
    registerOnGlobalContext("prompt", "ui/dialogs");
    registerOnGlobalContext("XMLHttpRequest", "xhr");
    registerOnGlobalContext("FormData", "xhr");
github nativescript-rtl / ui / node_modules / tns-core-modules / globals / globals.js View on Github external
var timer = require("timer");
            var dialogs = require("ui/dialogs");
            var xhr = require("xhr");
            var fetch_1 = require("fetch");
            snapshotGlobals = snapshotGlobals || {
                setTimeout: timer.setTimeout,
                clearTimeout: timer.clearTimeout,
                setInterval: timer.setInterval,
                clearInterval: timer.clearInterval,
                alert: dialogs.alert,
                confirm: dialogs.confirm,
                prompt: dialogs.prompt,
                login: dialogs.login,
                action: dialogs.action,
                XMLHttpRequest: xhr.XMLHttpRequest,
                FormData: xhr.FormData,
                fetch: fetch_1.fetch,
                Headers: fetch_1.Headers,
                Request: fetch_1.Request,
                Response: fetch_1.Response,
            };
        }
        var consoleModule = require("console").Console;
        global.console = global.console || new consoleModule();
        Object.assign(global, snapshotGlobals);
    }
    else {
        registerOnGlobalContext("setTimeout", "timer");
        registerOnGlobalContext("clearTimeout", "timer");
        registerOnGlobalContext("setInterval", "timer");
        registerOnGlobalContext("clearInterval", "timer");
        registerOnGlobalContext("alert", "ui/dialogs");