Skip to content

Commit 6310766

Browse files
committed
Update README.md
1 parent 643fec0 commit 6310766

1 file changed

Lines changed: 4 additions & 133 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,7 @@ See it in action on companion service: [APIembed](https://apiembed.com/)
1212
[![Coverage Status][codeclimate-coverage]][codeclimate-url]
1313
[![Dependencies][david-image]][david-url]
1414

15-
## Table of contents
16-
- [Targets](#Targets)
17-
- [Installation](#installation)
18-
- [Usage](#usage)
19-
- [Documentation](#documentation)
20-
- [Bugs and feature requests](#bugs-and-feature-requests)
21-
- [Contributing](#contributing)
22-
- [Versioning](#versioning)
23-
- [License](#license)
24-
25-
## Targets
26-
27-
Currently the following output [targets](/src/targets) are supported:
28-
29-
- Shell
30-
- [cURL](http://curl.haxx.se/)
31-
- [HTTPie](http://httpie.org)
32-
- [Wget](https://www.gnu.org/software/wget/)
33-
- Java
34-
- [Unirest](http://unirest.io/java.html)
35-
- Node.js
36-
- [Native](http://nodejs.org/api/http.html#http_http_request_options_callback)
37-
- [Request](https://github.com/request/request)
38-
- [Unirest](http://unirest.io/nodejs.html)
39-
- Ruby
40-
- [Native](http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html)
41-
- PHP
42-
- [ext-curl](http://php.net/manual/en/book.curl.php)
43-
- [pecl/http v1](http://php.net/manual/en/book.http.php)
44-
- [pecl/http v2](http://devel-m6w6.rhcloud.com/mdref/http)
45-
- Python
46-
- [Python 3](https://docs.python.org/3/library/http.client.html)
47-
- [Requests](http://docs.python-requests.org/en/latest/api/#requests.request)
48-
- Objective-C
49-
- [NSURLSession](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html)
50-
- Swift
51-
- [NSURLSession](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html)
52-
- Go
53-
- [Native](http://golang.org/pkg/net/http/#NewRequest)
54-
- OCaml
55-
- [CoHTTP](https://github.com/mirage/ocaml-cohttp)
56-
57-
## Installation
15+
## Install
5816

5917
install from source or through [npm](https://www.npmjs.com/):
6018

@@ -63,13 +21,11 @@ install from source or through [npm](https://www.npmjs.com/):
6321
npm install --global httpsnippet
6422

6523
# to use as a module
66-
npm install httpsnippet
24+
npm install --save httpsnippet
6725
```
6826

6927
## Usage
7028

71-
### CLI
72-
7329
```
7430
Usage: httpsnippet [options] <file>
7531
@@ -147,7 +103,7 @@ snippets/
147103
└── endpoint-3.js
148104
```
149105

150-
### Module
106+
## API
151107

152108
```js
153109
var httpsnippet = require('httpsnippet');
@@ -173,91 +129,6 @@ console.log(snippet.convert('php', 'curl'));
173129

174130
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.
175131

176-
### Output Targets
177-
178-
output [targets](/src/targets) are simple modules that expose a constructor *(which handles the transformation)* and a meta `info` property.
179-
180-
```js
181-
module.exports = function (opts) {
182-
// optionally process `opts` object for target specific configuration
183-
//
184-
// process `this.source` object
185-
//
186-
// return processed output as string
187-
};
188-
189-
module.exports.info = {
190-
key: 'curl',
191-
title: 'cURL',
192-
link: 'http://curl.haxx.se/',
193-
description: 'curl is a command line tool and library for transferring data with URL syntax',
194-
extname: '.sh'
195-
};
196-
```
197-
198-
### Target Options
199-
200-
### Shell
201-
202-
##### cURL
203-
204-
| Option | Default | Description |
205-
| -------- | ------- | ------------------------------------------------------------------------ |
206-
| `short` | `false` | use short form of cURL CLI options |
207-
| `indent` | ` ` | line break & indent output value, set to `false` to disable line breaks |
208-
209-
##### HTTPie
210-
211-
| Option | Default | Description |
212-
| --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
213-
| `body` | `false` | only the response body is printed |
214-
| `headers` | `false` | only the response headers are printed |
215-
| `verbose` | `false` | print the whole HTTP exchange (request and response) |
216-
| `print` | `false` | selects parts of the HTTP exchange, e.g. `--print=Hh` *(see [httpie docs](https://github.com/jakubroztocil/httpie#output-options))* |
217-
| `cert` | `false` | use a client side certificate *(see [httpie docs](https://github.com/jakubroztocil/httpie#client-side-ssl-certificate))* |
218-
| `verify` | `false` | server SSL certificate verification *(see [httpie docs](https://github.com/jakubroztocil/httpie#server-ssl-certificate-verification))* |
219-
| `pretty` | `false` | syntax highlighting *(see [httpie docs](https://github.com/jakubroztocil/httpie#colors-and-formatting))* |
220-
| `style` | `false` | syntax highlighting *(see [httpie docs](https://github.com/jakubroztocil/httpie#colors-and-formatting))* |
221-
| `timeout` | `false` | overwrite the default *30s* timeout |
222-
| `short` | `false` | use short form of cURL CLI options |
223-
| `indent` | ` ` | line break & indent output value, set to `false` to disable line breaks |
224-
225-
##### Wget
226-
227-
| Option | Default | Description |
228-
| --------- | ------- | ------------------------------------------------------------------------ |
229-
| `short` | `false` | use short form of cURL CLI options |
230-
| `indent` | ` ` | line break & indent output value, set to `false` to disable line breaks |
231-
| `verbose` | `false` | by default, `--quiet` is always used, unless `verbose` is set to `true` |
232-
233-
### Objective-C
234-
235-
##### NSURLSession
236-
237-
| Option | Default | Description |
238-
| --------- | ------- | ------------------------------------------------------------------------ |
239-
| `timeout` | `10` | NSURLRequest timeout |
240-
| `indent` | ` ` | line break & indent output value |
241-
| `pretty` | `true` | indent extracted headers/parameters in `NSDictionary` literals |
242-
243-
### Swift
244-
245-
##### NSURLSession
246-
247-
| Option | Default | Description |
248-
| --------- | ------- | ------------------------------------------------------------------------ |
249-
| `timeout` | `10` | NSURLRequest timeout |
250-
| `indent` | ` ` | line break & indent output value |
251-
| `pretty` | `true` | indent extracted headers/parameters in `NSDictionary` literals |
252-
253-
### Go
254-
255-
| Option | Default | Description |
256-
| --------------- | ------- | ------------------------------------------------------------------------ |
257-
| `errorChecking` | `false` | add error checking for request, response and body |
258-
| `printBody` | `true` | include code to print the body as a string |
259-
| `timeout` | `-1` | sets a request timeout in seconds (requires go 1.3+) |
260-
261132
## Bugs and feature requests
262133

263134
Have a bug or a feature request? Please first read the [issue guidelines](CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](/issues).
@@ -288,7 +159,7 @@ For more information on SemVer, please visit <http://semver.org/>.
288159

289160
## License
290161

291-
Licensed under [The MIT License](LICENSE).
162+
[MIT](LICENSE) &copy; [Mashape](https://www.mashape.com)
292163

293164
[license-url]: https://github.com/Mashape/httpsnippet/blob/master/LICENSE
294165

0 commit comments

Comments
 (0)