How to use aurelia-fetch-client - 10 common examples

To help you get started, we’ve selected a few aurelia-fetch-client 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 freshcutdevelopment / Aurelia-in-Action / Chapter-8 / Listing_8.1_book-api.js View on Github external
addBook(book){
        return this.http.fetch('books', {
            method: 'post',
            body: json(book)
            })
            .then(response => response.json())
            .then(createdBook => {
                return createdBook;
            })
            .catch(error => {
                console.log('Error adding book');
            });
    }
github freshcutdevelopment / Aurelia-in-Action / Chapter-12-Complete / my-books / src / services / book-api.js View on Github external
addBook(book){
        return this.http.fetch('books', {
            method: 'post',
            body: json(book)
            })
            .then(response => response.json())
            .then(createdBook => {
                return createdBook;
            })
            .catch(error => {
                console.log('Error adding book');
            });
    }
github freshcutdevelopment / Aurelia-in-Action / Chapter-8 / Listing_8.5_book-api.js View on Github external
addBook(book){
        return this.http.fetch('books', {
            method: 'post',
            body: json(book)
            })
            .then(response => response.json())
            .then(createdBook => {
                return createdBook;
            })
            .catch(error => {
                console.log('Error adding book');
            });
    }
github freshcutdevelopment / Aurelia-in-Action / Chapter-8 / Listing_8.6_book-api.js View on Github external
addBook(book){
        return this.http.fetch('books', {
            method: 'post',
            body: json(book)
            })
            .then(response => response.json())
            .then(createdBook => {
                return createdBook;
            })
            .catch(error => {
                console.log('Error adding book.');
            });
    }
github freshcutdevelopment / Aurelia-in-Action / Chapter-10-Complete / my-books / src / services / book-api.js View on Github external
addBook(book){
        return this.http.fetch('books', {
            method: 'post',
            body: json(book)
            })
            .then(response => response.json())
            .then(createdBook => {
                return createdBook;
            })
            .catch(error => {
                console.log('Error adding book');
            });
    }
github adarshpastakia / aurelia-ui-framework / dist / commonjs / utils / ui-http.js View on Github external
UIHttpService.prototype.patch = function (slug, body, headers) {
        var _this = this;
        if (headers === void 0) { headers = true; }
        this.logger.info("patch [" + slug + "]");
        return this.httpClient
            .fetch(slug, {
            method: 'patch',
            body: aurelia_fetch_client_1.json(body),
            mode: 'cors',
            headers: this.__getHeaders(headers)
        })
            .then(function (resp) { return _this.__getResponse(resp); });
    };
    UIHttpService.prototype.put = function (slug, body, headers) {
github adarshpastakia / aurelia-ui-framework / dist / native-modules / aurelia-ui-framework.js View on Github external
UIHttpService.prototype.patch = function (slug, body, headers) {
        var _this = this;
        if (headers === void 0) { headers = true; }
        this.logger.info("patch [" + slug + "]");
        return this.httpClient
            .fetch(slug, {
            body: json(body),
            headers: this.__getHeaders(headers),
            method: "patch",
            mode: "cors"
        })
            .then(function (resp) { return _this.__getResponse(resp); });
    };
    UIHttpService.prototype.put = function (slug, body, headers) {
github adarshpastakia / aurelia-ui-framework / dist / commonjs / aurelia-ui-framework.js View on Github external
UIHttpService.prototype.patch = function (slug, body, headers) {
        var _this = this;
        if (headers === void 0) { headers = true; }
        this.logger.info("patch [" + slug + "]");
        return this.httpClient
            .fetch(slug, {
            body: aureliaFetchClient.json(body),
            headers: this.__getHeaders(headers),
            method: "patch",
            mode: "cors"
        })
            .then(function (resp) { return _this.__getResponse(resp); });
    };
    UIHttpService.prototype.put = function (slug, body, headers) {
github crmorgan / hotel-management-system / src / PublicWebsite / src / modules / payment / payment.ts View on Github external
private sendPaymentRequest(url, body) {
		this.httpClient.fetch(url, {
			method: 'PUT',
			body: json(body)
		})
		.then(response => response.json())
		.then(data => {
      		this.messageBus.publish(Events.PaymentSubmitted);
		});
	}
}
github crmorgan / hotel-management-system / src / PublicWebsite / src / modules / guests / guests.ts View on Github external
private sendGuestRequest (url, body) {
		this.httpClient.fetch(url, {
			method: 'PUT',
			body: json(body)
		})
		.then(response => response.json())
		.then(data => {
      this.messageBus.publish(Events.GuestSubmitted);
		});
	}
}

aurelia-fetch-client

A simple client based on the Fetch standard.

MIT
Latest version published 6 years ago

Package Health Score

53 / 100
Full package analysis

Popular aurelia-fetch-client functions