How to use @aurelia/fetch-client - 4 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 aurelia / aurelia / packages / aurelia / dist / umd / index.js View on Github external
Object.defineProperty(exports, "__esModule", { value: true });
    var quick_start_1 = require("./quick-start");
    exports.Aurelia = quick_start_1.Aurelia;
    exports.default = quick_start_1.Aurelia;
    var debug_1 = require("@aurelia/debug");
    exports.DebugConfiguration = debug_1.DebugConfiguration;
    exports.TraceConfiguration = debug_1.TraceConfiguration;
    var fetch_client_1 = require("@aurelia/fetch-client");
    // RetryConfiguration,
    // RetryableRequest,
    // ValidInterceptorMethodName,
    exports.json = fetch_client_1.json;
    // retryStrategy,
    // RetryInterceptor,
    exports.HttpClientConfiguration = fetch_client_1.HttpClientConfiguration;
    exports.HttpClient = fetch_client_1.HttpClient;
    var jit_1 = require("@aurelia/jit");
    // AttrSyntax,
    // IAttributeParser,
    exports.attributePattern = jit_1.attributePattern;
    // AttributePatternDefinition,
    exports.IAttributePattern = jit_1.IAttributePattern;
    // IAttributePatternHandler,
    // Interpretation,
    // ISyntaxInterpreter,
    // AtPrefixedTriggerAttributePattern,
    // ColonPrefixedBindAttributePattern,
    // DotSeparatedAttributePattern,
    // RefAttributePattern,
    exports.bindingCommand = jit_1.bindingCommand;
    // BindingCommandDefinition,
    // BindingCommandKind,
github aurelia / aurelia / packages / aurelia / dist / umd / index.js View on Github external
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var quick_start_1 = require("./quick-start");
    exports.Aurelia = quick_start_1.Aurelia;
    exports.default = quick_start_1.Aurelia;
    var debug_1 = require("@aurelia/debug");
    exports.DebugConfiguration = debug_1.DebugConfiguration;
    exports.TraceConfiguration = debug_1.TraceConfiguration;
    var fetch_client_1 = require("@aurelia/fetch-client");
    // RetryConfiguration,
    // RetryableRequest,
    // ValidInterceptorMethodName,
    exports.json = fetch_client_1.json;
    // retryStrategy,
    // RetryInterceptor,
    exports.HttpClientConfiguration = fetch_client_1.HttpClientConfiguration;
    exports.HttpClient = fetch_client_1.HttpClient;
    var jit_1 = require("@aurelia/jit");
    // AttrSyntax,
    // IAttributeParser,
    exports.attributePattern = jit_1.attributePattern;
    // AttributePatternDefinition,
    exports.IAttributePattern = jit_1.IAttributePattern;
    // IAttributePatternHandler,
    // Interpretation,
    // ISyntaxInterpreter,
    // AtPrefixedTriggerAttributePattern,
    // ColonPrefixedBindAttributePattern,
    // DotSeparatedAttributePattern,
    // RefAttributePattern,
    exports.bindingCommand = jit_1.bindingCommand;
    // BindingCommandDefinition,
github aurelia / aurelia / test / realworld / src / shared / services / api-service.ts View on Github external
public async post(path: string, body = {}) {
    const options = {
      body: json(body),
      headers: this.setHeaders(),
      method: 'POST',
    };
    try {
      const response = await this.http.fetch(`${config.apiUrl}${path}`, options);
      return await status(response);
    } catch (error) {
      try {
        return await parseError(error);
      } catch {
        return undefined;
      }
    }
  }
github aurelia / aurelia / test / realworld / src / shared / services / api-service.ts View on Github external
public async put(path: string, body = {}) {
    const options = {
      body: json(body),
      headers: this.setHeaders(),
      method: 'PUT',
    };
    try {
      const response = await this.http.fetch(`${config.apiUrl}${path}`, options);
      return await status(response);
    } catch (error) {
      try {
        return await parseError(error);
      } catch {
        return undefined;
      }
    }
  }

@aurelia/fetch-client

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![CircleCI](https://circleci.com/

MIT
Latest version published 3 days ago

Package Health Score

84 / 100
Full package analysis