Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

q-http

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

q-http

Q promise based HTTP client and server interface

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

Provides a Q promise API for HTTP requests and responses. This should resemble JSGI and its hypothetical inverse, but I haven't pored through the specification to ensure this.

The API

Server(respond(request):Response*)
    listen(port:Number):Server*
    stop():Undefined*

read(url:String):String
read(request:Request):String
request(url:String):Response*
request(request:Request):Response*

{Client,Server}Request:Object

    url:String the full URL, regardless of routing
    path:String the full path, regardless of routing
    scriptName:String the routed portion
        of the path, e.g., "" for the
        root document
    pathInfo:String the part of the path
        that remains to be routed, e.g.,
        "/" for the root document
    version:Array HTTP version
    scheme:String e.g., "http"
    method:String e.g., "GET"
    host:String
    port:Number
    remoteHost:String
    remotePort:Number
    headers:Object
    body*
        forEach(write(String*)):Undefined*
    node the wrapped Node request object

{Client,Server}Response:Object

    status:Number
    headers:Object
    body*
        forEach(write(String*)):Undefined*
    onclose:Function?
    node the wrapped Node response object

Conventions

`*` indicates that a value may be a promise
`?` indicates optional

Copyright 2009, 2010, 2011 Kristopher Michael Kowal MIT License (enclosed)

FAQs

Package last updated on 31 Aug 2011

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