Socket
Book a DemoInstallSign in
Socket

pyrsmk-rip

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyrsmk-rip

REST in peace

latest
Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
21
200%
Maintainers
1
Weekly downloads
 
Created
Source

RIP 0.4.0

RIP (REST in peace) is a tool for sending synchroneous REST requests by generating a hidden FORM on-the-fly. It's really useful when developing with frameworks like Slim or Lumy without using synchroneous ajax requests : it just send data like a normal FORM would do.

Install

You can pick the minified library or install it with :

npm install pyrsmk-rip
bower install rip

Use

RIP handles basic POST, PUT and DELETE requests, but can manage other manual request types.

// API
RIP.POST(<url>, [data]);
RIP.PUT(<url>, [data]);
RIP.DELETE(<url>, [data]);
RIP.map(<type>, <url>, [data]);

// Simple example
RIP.POST('/url');


// Data example
RIP.PUT('/newclient', {
    firstname   : 'Foo',
    lastname    : 'Bar',
    age         : 27,
    children    : [
        'Audrey',
        'Nicholas',
        'Alison'
    ]
});

// Map example
RIP.map('REQUEST_TYPE', '/someurl', {
    foo: 'bar'
});

If you pass a boolean value into the data parameter, the value will be considered as a checkbox and will return on or `` to your remote script.

Please note that requests are using _METHOD POST data attribute, as used in Slim and Lumy. But if you need to change the name of this attribute to __REQUEST__ (per example), you can do this:

RIP.setRequestAttributeName('__REQUEST__');

License

Published under the MIT license.

Keywords

rest

FAQs

Package last updated on 04 Jan 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