yaronn / ws.js

A WS-* client stack for node.js. Written in pure javascript!
http://webservices20.blogspot.com/
104 stars 64 forks source link

Added support to add/customize request options (Ex: timeout, proxy etc.) #32

Open maulik07 opened 8 years ago

maulik07 commented 8 years ago

In response to Issue #31 Addresses PR #8

Added support to customize and tweak all available options listed under request module for node: Available Options.

The options could be passed in as a JSON Object to constructor argument of Http handler which will in-turn club these options with the required/default ones while sending a request.

The constructor argument could be omitted/skipped, under which case the API sticks to its current core functionality.

Sample Usage: var handlers = [ new Security({}, [new UsernameToken({username: "yaron", password: "1234"})]) , new Http({timeout: 3000}) ]

Jonlondon commented 7 years ago

Could be strange but in my case I need to edit headers. Should it be more interesting to replace 'jsonConcat' by an extend functionality so that we can replace any options?