@klippa/nativescript-http
Version:
The best way to do HTTP requests in NativeScript, a drop-in replacement for the core HTTP with important improvements and additions like proper connection pooling, form data support and certificate pinning
8 lines (7 loc) • 603 B
TypeScript
import { NSFileSystem } from "@nativescript/angular";
import { Observable } from "rxjs";
export declare type httpResponseFactory<T> = (url: string, body: any, status: number) => T;
export declare type httpErrorFactory = (url: string, body: any, status: number) => any;
export declare function isLocalRequest(url: string): boolean;
export declare function getAbsolutePath(url: string, nsFileSystem: NSFileSystem): string;
export declare function processLocalFileRequest<T>(url: string, nsFileSystem: NSFileSystem, successResponse: httpResponseFactory<T>, errorResponse: httpErrorFactory): Observable<T>;