New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

most-request

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

most-request

Most.js wrapper for superagent library

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

most-request

Simple Most.js wrapper around superagent

Let me have it!

yarn add most-request
#or
npm install --save most-request

API

request(options: RequestOptions): Stream<Response>

Creates a stream of Response, and upon subscription, will execute the specified request as defined by the given options and emit the Response.

import { request } from 'most-request';

request({ url: 'http://example.com', method: 'GET' })
  .observe((response: Response) => {
    ...
  })

Types

The types used in the API section

export interface Response {
    text: string;
    body: any;
    files: any;
    header: any;
    type: string;
    charset: string;
    status: number;
    statusType: number;
    info: boolean;
    ok: boolean;
    redirect: boolean;
    clientError: boolean;
    serverError: boolean;
    error: Error;
    accepted: boolean;
    noContent: boolean;
    badRequest: boolean;
    unauthorized: boolean;
    notAcceptable: boolean;
    notFound: boolean;
    forbidden: boolean;
    xhr: XMLHttpRequest;
    get(header: string): string;
}

export declare type HTTPMethod =
  'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';

export interface RequestOptions {
    url: string;
    method: HTTPMethod;
    query?: Object;
    send?: Object;
    headers?: Object;
    accept?: string;
    type?: string;
    user?: string;
    password?: string;
    field?: Object;
    progress?: boolean;
    attach?: Array<Attachment>;
    agent?: AgentOptions;
    withCredentials?: boolean;
    redirects?: number;
    lazy?: boolean;
}

export interface Attachment {
    name: string;
    path: string;
    filename?: string;
}

export interface AgentOptions {
    key: string;
    cert: string;
}

Keywords

FAQs

Package last updated on 11 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc