Skip to content

Commit 389d499

Browse files
committed
Update README.md
1 parent 263f602 commit 389d499

1 file changed

Lines changed: 18 additions & 22 deletions

File tree

‎README.md‎

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ Usage: httpsnippet [options] <file>
5353
5454
Options:
5555
56-
-h, --help output usage information
57-
-V, --version output the version number
58-
-t, --target <target> target output
59-
-o, --output <directory> write output to directory
60-
-n, --output-name <name> output file name
56+
-h, --help output usage information
57+
-V, --version output the version number
58+
-t, --target <target> target output
59+
-c, --client [client] target client library
60+
-o, --output <directory> write output to directory
61+
-n, --output-name <name> output file name
6162
```
6263

6364
#### Example
@@ -79,16 +80,13 @@ process single file (assumes [HAR Request Object](http://www.softwareishard.com/
7980
"headers": [
8081
{ "name": "Accept", "value": "text/plain" },
8182
{ "name": "Content-Type", "value": "application/json" },
82-
{ "name": "X-Pretty-Print", "value": "2" }
83+
{ "name": "X-Foo-Bar", "value": "Baz" }
8384
],
8485
"cookies": [
85-
{ "name": "foo", "value": "bar", "path": "/", "domain": "www.mockbin.com", "expires": "2015-02-11T04:28:14.821Z", "httpOnly": false, "secure": false },
86-
{ "name": "bar", "value": "baz", "path": "/", "domain": "www.mockbin.com", "expires": "2015-02-11T04:28:14.821Z", "httpOnly": false, "secure": false }
86+
{ "name": "foo", "value": "bar" },
87+
{ "name": "bar", "value": "baz" }
8788
],
88-
"headersSize": 44,
89-
"bodySize": 14,
9089
"postData": {
91-
"size": 14,
9290
"mimeType": "application/json",
9391
"text": "{\"foo\": \"bar\"}"
9492
}
@@ -107,7 +105,7 @@ snippets/
107105
process multiple files:
108106

109107
```shell
110-
httpsnippet /*.json --family node --target native --output ./snippets
108+
httpsnippet /*.json --target node --client native --output ./snippets
111109
```
112110

113111
```shell
@@ -151,11 +149,11 @@ console.log(snippet.convert('php', 'curl'));
151149

152150
## Documentation
153151

154-
At the heart of this module is the [HAR Request object](http://www.softwareishard.com/blog/har-12-spec/#request) as the http request description format, please review some of the sample JSON HAR Request objects in [test fixtures](/test/fixtures), or read the [HAR Docs](http://www.softwareishard.com/blog/har-12-spec/#request) for more details.
152+
At the heart of this module is the [HAR Request object](http://www.softwareishard.com/blog/har-12-spec/#request) as the http request description format, please review some of the sample JSON HAR Request objects in [test fixtures](/test/fixtures/requests), or read the [HAR Docs](http://www.softwareishard.com/blog/har-12-spec/#request) for more details.
155153

156154
### Output Targets
157155

158-
output [targets](/src/targets) are simple modules that expose a constructor *(which handles the transformation)* and a utility `info` method
156+
output [targets](/src/targets) are simple modules that expose a constructor *(which handles the transformation)* and a meta `info` property.
159157

160158
```js
161159
module.exports = function (opts) {
@@ -166,14 +164,12 @@ module.exports = function (opts) {
166164
// return processed output as string
167165
};
168166

169-
module.exports.info = function () {
170-
// return target info
171-
return {
172-
key: 'native', // target key
173-
ext: '.js', // preferred extension
174-
title: '', // target label
175-
description: '' // target description
176-
};
167+
module.exports.info = {
168+
key: 'curl',
169+
title: 'cURL',
170+
link: 'http://curl.haxx.se/',
171+
description: 'curl is a command line tool and library for transferring data with URL syntax',
172+
extname: '.sh'
177173
};
178174
```
179175

0 commit comments

Comments
 (0)