Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Jul 28, 2020
2 parents 49bc69b + 692f540 commit f28927f
Show file tree
Hide file tree
Showing 59 changed files with 1,263 additions and 440 deletions.
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ snippets/

#### source

*Required*
*Required*
Type: `object`

Name of [conversion target](https://github.com/Mashape/httpsnippet/wiki/Targets)
Expand All @@ -87,7 +87,7 @@ var snippet = new HTTPSnippet({

#### target

*Required*
*Required*
Type: `string`

Name of [conversion target](https://github.com/Mashape/httpsnippet/wiki/Targets)
Expand Down Expand Up @@ -119,7 +119,7 @@ console.log(snippet.convert('node', {

#### target

*Required*
*Required*
Type: `string`

Name of [conversion target](https://github.com/Mashape/httpsnippet/wiki/Targets)
Expand Down Expand Up @@ -153,6 +153,39 @@ console.log(snippet.convert('shell', 'curl', {
console.log(snippet.convert('node', 'unirest'));
```

### addTarget(target)
#### target

*Required*
Type: `object`

Representation of a [conversion target](https://github.com/Kong/httpsnippet/wiki/Creating-Targets). Can use this to use targets that are not officially supported.

```js
const customLanguageTarget = require('httpsnippet-for-my-lang');
HTTPSnippet.addTarget(customLanguageTarget);
```

### addTargetClient(target, client)
### target

*Required*
Type: `string`

Name of [conversion target](https://github.com/Mashape/httpsnippet/wiki/Targets)

### client

*Required*
Type: `object`

Representation of a [conversion target client](https://github.com/Kong/httpsnippet/wiki/Creating-Targets). Can use this to use target clients that are not officially supported.

```js
const customClient = require('httpsnippet-for-my-node-http-client');
HTTPSnippet.addTargetClient('node', customClient);
```

## Documentation

At the heart of this module is the [HAR Format](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.
Expand Down
Loading

0 comments on commit f28927f

Please sign in to comment.