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

@hapiness/http

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapiness/http

Http Module for the Hapiness framework, allowing user to deal with http request

  • 1.0.0-rc.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source
Hapiness
build coveralls dependencies devDependencies

Http Module

Http Module for the Hapiness framework, allowing user to deal with http request.

Table of contents

Using http module inside Hapiness application

yarn or npm it in your package.json

$ npm install --save @hapiness/http

or

$ yarn add @hapiness/http
"dependencies": {
    "@hapiness/core": "^1.0.0-rc.3",
    "@hapiness/http": "^1.0.0-rc.3",
    //...
}
//...

import HttpModule

import { HapinessModule } from '@hapiness/core';
import { HttpModule } from '@hapiness/http';

@HapinessModule({
    version: '1.0.0',
    declarations: [
        LibWithHttpCalls
    ],
    imports: [
        HttpModule
    ]
})
class HapinessModuleNeedsHttpModule {}

use it anywhere

You can use HttpService anywhere in your module with dependency injection.

import { Lib } from '@hapiness/core';
import { HttpService } from '@hapiness/http';

@Lib()
class LibWithHttpCalls {
    constructor(private _http: HttpService){}
    
    crawlWebPage(): void {
        this._http.get('http://www.google.fr').subscribe(
            (data) => {
        
                if (data.response.statusCode === 200) {
                    console.log(data.body); // Show the HTML for the Google homepage.
                }
            },
            (err) => console.error(err) // Show error in console
        );
    }
}

Back to top

API in Detail

This module is an encapsulation of Rx-Http-Request library to allow their features inside Hapiness framework.

Methods implemented are:

  • .request
  • .get(uri[, options])
  • .getBuffer(uri[, options])
  • .post(uri[, options])
  • .put(uri[, options])
  • .patch(uri[, options])
  • .delete(uri[, options])
  • .head(uri[, options])
  • .jar()
  • .cookie(str)

If you want to have all details for these methods, see Rx-Http-Request's API details.

Back to top

Contributing

To set up your development environment:

  1. clone the repo to your workspace,
  2. in the shell cd to the main folder,
  3. hit npm or yarn install,
  4. run npm or yarn run test.
    • It will lint the code and execute all tests.
    • The test coverage report can be viewed from ./coverage/lcov-report/index.html.

Back to top

Change History

  • v1.0.0-rc.3 (2017-07-04)
    • Latest packages' versions.
    • Module version related to core version.
  • v1.0.0-beta.6 (2017-05-26)
    • Latest packages' versions.
    • Module version related to core version.
  • v1.0.0-beta.5 (2017-05-15)
    • Latest packages' versions.
    • Module version related to core version.
  • v1.0.0-beta.4 (2017-05-15)
    • Latest packages' versions.
    • Module version related to core version.
  • v1.0.0-beta.3 (2017-05-12)
    • Latest packages' versions.
    • Add check files in packaging process.
    • Extended tsconfig.
    • Module version related to core version.
  • v1.0.0-beta.2 (2017-04-18)
    • Create Http module.
    • Implementation of Rx-Http-Request API.
    • Tests module API.
    • Documentation.
    • Module version related to core version.

Back to top

Maintainers

tadaweb
Julien FauvilleAntoine GomezSébastien RitzNicolas Jessel

Back to top

License

Copyright (c) 2017 Hapiness Licensed under the MIT license.

Back to top

Keywords

FAQs

Package last updated on 05 Jul 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