Skip to content
Ahmad Nassri edited this page Mar 20, 2015 · 3 revisions

Targets

Currently the following output targets are supported:

Output Targets

output targets are simple modules that expose a constructor (which handles the transformation) and a meta info property.

module.exports = function (opts) {
  // optionally process `opts` object for target specific configuration
  // 
  // process `this.source` object
  // 
  // return processed output as string
};

module.exports.info = {
  key: 'curl',
  title: 'cURL',
  link: 'http://curl.haxx.se/',
  description: 'curl is a command line tool and library for transferring data with URL syntax',
  extname: '.sh'
};

Target Options

Shell

cURL
Option Default Description
short false use short form of cURL CLI options
indent line break & indent output value, set to false to disable line breaks
HTTPie
Option Default Description
body false only the response body is printed
headers false only the response headers are printed
verbose false print the whole HTTP exchange (request and response)
print false selects parts of the HTTP exchange, e.g. --print=Hh (see httpie docs)
cert false use a client side certificate (see httpie docs)
verify false server SSL certificate verification (see httpie docs)
pretty false syntax highlighting (see httpie docs)
style false syntax highlighting (see httpie docs)
timeout false overwrite the default 30s timeout
short false use short form of cURL CLI options
indent line break & indent output value, set to false to disable line breaks
Wget
Option Default Description
short false use short form of cURL CLI options
indent line break & indent output value, set to false to disable line breaks
verbose false by default, --quiet is always used, unless verbose is set to true

Objective-C

NSURLSession
Option Default Description
timeout 10 NSURLRequest timeout
indent line break & indent output value
pretty true indent extracted headers/parameters in NSDictionary literals

Swift

NSURLSession
Option Default Description
timeout 10 NSURLRequest timeout
indent line break & indent output value
pretty true indent extracted headers/parameters in NSDictionary literals

Go

Option Default Description
errorChecking false add error checking for request, response and body
printBody true include code to print the body as a string
timeout -1 sets a request timeout in seconds (requires go 1.3+)
Clone this wiki locally