JSPM

  • Created
  • Published
  • Downloads 347958
  • Score
    100M100P100Q212843F

Encodes `x-www-form-urlencoded` string data

Package Exports

  • form-urlencoded

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (form-urlencoded) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

form-urlencoded

(c)Bumblehead,JBlashill 2013,2014 MIT-license

OVERVIEW:

form-urlencoded encodes x-www-form-urlencoded string data. It may be used in an ecmascript environment, such as a browser or node.js.

application/x-www-form-urlencoded is a string encoding used, primarily, when an HTML form is submitted. The form data is serialised in this format and sent to a server.

The format is not well defined. Serialising complex data, such as a javascript object, is beyond the specification.

Server softwares do share methods for handling complex urlencoded data and so there is a "defacto" standard for serializing such data. This is the standard that form-urlencoded follows.


INSTALL:

form-urlencoded may be downloaded directly or installed through npm.

  • npm
$ npm install form-urlencoded
  • Direct Download
$ git clone https://github.com/iambumblehead/form-urlencoded.git

TEST:

to run tests, use npm test from a shell.

$ npm test

GET STARTED:

  1. Object encoding
   var FormUrlencoded = require('form-urlencoded');
   var result = FormUrlencoded.encode({
     propStr1 : 'str1',
     propStr2 : 'str2',
     propObj1 : { 
       objPropStr1 : 'objStr1', 
       objPropStr2 : 'objStr2'
     }
   });
   console.log(result);
   //propStr1=str1&propStr2=str2&propObj1%5BobjPropStr1%5D=objStr1&propObj1%5BobjPropStr2%5D=objStr2

---------------------------------------------------------
#### <a id="license">License:

![scrounge](http://github.com/iambumblehead/scroungejs/raw/master/img/hand.png) 

(The MIT License)

Copyright (c) 2012 [Bumblehead][0] <chris@bumblehead.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.