m0603va 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Laba6/file1.js +23 -0
- package/Laba6/file2.js +23 -0
- package/Laba6/index.html +63 -0
- package/Laba6/m0603.js +29 -0
- package/Laba6/node_modules/.package-lock.json +83 -0
- package/Laba6/node_modules/httpntlm/.jshintrc +4 -0
- package/Laba6/node_modules/httpntlm/LICENSE +20 -0
- package/Laba6/node_modules/httpntlm/README.md +148 -0
- package/Laba6/node_modules/httpntlm/httpntlm.js +104 -0
- package/Laba6/node_modules/httpntlm/ntlm.js +390 -0
- package/Laba6/node_modules/httpntlm/package.json +33 -0
- package/Laba6/node_modules/httpreq/LICENSE +19 -0
- package/Laba6/node_modules/httpreq/README.md +383 -0
- package/Laba6/node_modules/httpreq/contributors.md +26 -0
- package/Laba6/node_modules/httpreq/lib/httpreq.js +681 -0
- package/Laba6/node_modules/httpreq/package.json +102 -0
- package/Laba6/node_modules/m0603sol/m0603.js +29 -0
- package/Laba6/node_modules/m0603sol/package.json +12 -0
- package/Laba6/node_modules/nodemailer/.gitattributes +6 -0
- package/Laba6/node_modules/nodemailer/.prettierrc.js +8 -0
- package/Laba6/node_modules/nodemailer/CHANGELOG.md +725 -0
- package/Laba6/node_modules/nodemailer/CODE_OF_CONDUCT.md +76 -0
- package/Laba6/node_modules/nodemailer/CONTRIBUTING.md +67 -0
- package/Laba6/node_modules/nodemailer/LICENSE +16 -0
- package/Laba6/node_modules/nodemailer/README.md +97 -0
- package/Laba6/node_modules/nodemailer/SECURITY.txt +22 -0
- package/Laba6/node_modules/nodemailer/lib/addressparser/index.js +313 -0
- package/Laba6/node_modules/nodemailer/lib/base64/index.js +142 -0
- package/Laba6/node_modules/nodemailer/lib/dkim/index.js +251 -0
- package/Laba6/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
- package/Laba6/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
- package/Laba6/node_modules/nodemailer/lib/dkim/sign.js +117 -0
- package/Laba6/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
- package/Laba6/node_modules/nodemailer/lib/fetch/index.js +274 -0
- package/Laba6/node_modules/nodemailer/lib/json-transport/index.js +82 -0
- package/Laba6/node_modules/nodemailer/lib/mail-composer/index.js +558 -0
- package/Laba6/node_modules/nodemailer/lib/mailer/index.js +427 -0
- package/Laba6/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
- package/Laba6/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
- package/Laba6/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
- package/Laba6/node_modules/nodemailer/lib/mime-node/index.js +1290 -0
- package/Laba6/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
- package/Laba6/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
- package/Laba6/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
- package/Laba6/node_modules/nodemailer/lib/nodemailer.js +143 -0
- package/Laba6/node_modules/nodemailer/lib/qp/index.js +219 -0
- package/Laba6/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
- package/Laba6/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
- package/Laba6/node_modules/nodemailer/lib/shared/index.js +638 -0
- package/Laba6/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
- package/Laba6/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
- package/Laba6/node_modules/nodemailer/lib/smtp-connection/index.js +1796 -0
- package/Laba6/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
- package/Laba6/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
- package/Laba6/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
- package/Laba6/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
- package/Laba6/node_modules/nodemailer/lib/well-known/index.js +47 -0
- package/Laba6/node_modules/nodemailer/lib/well-known/services.json +286 -0
- package/Laba6/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
- package/Laba6/node_modules/nodemailer/package.json +46 -0
- package/Laba6/node_modules/nodemailer/postinstall.js +101 -0
- package/Laba6/node_modules/nodemailer-fetch/.eslintrc.js +56 -0
- package/Laba6/node_modules/nodemailer-fetch/.travis.yml +19 -0
- package/Laba6/node_modules/nodemailer-fetch/CHANGELOG.md +30 -0
- package/Laba6/node_modules/nodemailer-fetch/Gruntfile.js +27 -0
- package/Laba6/node_modules/nodemailer-fetch/LICENSE +16 -0
- package/Laba6/node_modules/nodemailer-fetch/README.md +55 -0
- package/Laba6/node_modules/nodemailer-fetch/lib/cookies.js +275 -0
- package/Laba6/node_modules/nodemailer-fetch/lib/fetch.js +224 -0
- package/Laba6/node_modules/nodemailer-fetch/package.json +30 -0
- package/Laba6/node_modules/nodemailer-fetch/test/cookies-test.js +391 -0
- package/Laba6/node_modules/nodemailer-fetch/test/fetch-test.js +486 -0
- package/Laba6/node_modules/nodemailer-shared/.eslintrc.js +59 -0
- package/Laba6/node_modules/nodemailer-shared/.travis.yml +18 -0
- package/Laba6/node_modules/nodemailer-shared/Gruntfile.js +27 -0
- package/Laba6/node_modules/nodemailer-shared/LICENSE +16 -0
- package/Laba6/node_modules/nodemailer-shared/README.md +14 -0
- package/Laba6/node_modules/nodemailer-shared/lib/shared.js +282 -0
- package/Laba6/node_modules/nodemailer-shared/package.json +36 -0
- package/Laba6/node_modules/nodemailer-shared/test/fixtures/message.html +1 -0
- package/Laba6/node_modules/nodemailer-shared/test/shared-test.js +291 -0
- package/Laba6/node_modules/nodemailer-smtp-transport/.eslintrc.js +59 -0
- package/Laba6/node_modules/nodemailer-smtp-transport/Gruntfile.js +27 -0
- package/Laba6/node_modules/nodemailer-smtp-transport/LICENSE +19 -0
- package/Laba6/node_modules/nodemailer-smtp-transport/README.md +7 -0
- package/Laba6/node_modules/nodemailer-smtp-transport/lib/smtp-transport.js +281 -0
- package/Laba6/node_modules/nodemailer-smtp-transport/package.json +37 -0
- package/Laba6/node_modules/nodemailer-wellknown/.travis.yml +17 -0
- package/Laba6/node_modules/nodemailer-wellknown/LICENSE +19 -0
- package/Laba6/node_modules/nodemailer-wellknown/README.md +80 -0
- package/Laba6/node_modules/nodemailer-wellknown/index.js +47 -0
- package/Laba6/node_modules/nodemailer-wellknown/package.json +26 -0
- package/Laba6/node_modules/nodemailer-wellknown/services.json +255 -0
- package/Laba6/node_modules/nodemailer-wellknown/test.js +23 -0
- package/Laba6/node_modules/smtp-connection/.eslintrc.js +56 -0
- package/Laba6/node_modules/smtp-connection/CHANGELOG.md +164 -0
- package/Laba6/node_modules/smtp-connection/Gruntfile.js +27 -0
- package/Laba6/node_modules/smtp-connection/LICENSE +19 -0
- package/Laba6/node_modules/smtp-connection/README.md +200 -0
- package/Laba6/node_modules/smtp-connection/lib/data-stream.js +111 -0
- package/Laba6/node_modules/smtp-connection/lib/smtp-connection.js +1443 -0
- package/Laba6/node_modules/smtp-connection/package.json +41 -0
- package/Laba6/node_modules/underscore/LICENSE +23 -0
- package/Laba6/node_modules/underscore/README.md +22 -0
- package/Laba6/node_modules/underscore/package.json +41 -0
- package/Laba6/node_modules/underscore/underscore-min.js +6 -0
- package/Laba6/node_modules/underscore/underscore.js +1415 -0
- package/Laba6/package-lock.json +94 -0
- package/Laba6/package.json +17 -0
- package/Laba6.txt +31 -0
- package/file1.js +23 -0
- package/file2.js +23 -0
- package/index.html +63 -0
- package/m0603.js +29 -0
- package/m0603Sol/m0603.js +29 -0
- package/m0603Sol/package.json +12 -0
- package/package.json +17 -0
@@ -0,0 +1,383 @@
|
|
1
|
+
node-httpreq
|
2
|
+
============
|
3
|
+
|
4
|
+
node-httpreq is a node.js library to do HTTP(S) requests the easy way
|
5
|
+
|
6
|
+
Do GET, POST, PUT, PATCH, DELETE, OPTIONS, upload files, use cookies, change headers, ...
|
7
|
+
|
8
|
+
## Donate
|
9
|
+
|
10
|
+
Feel free [to buy me a pizza 🍕](https://www.buymeacoffee.com/samdecrock)
|
11
|
+
|
12
|
+
## Install
|
13
|
+
|
14
|
+
You can install __httpreq__ using the Node Package Manager (npm):
|
15
|
+
|
16
|
+
npm install httpreq
|
17
|
+
|
18
|
+
## Simple example
|
19
|
+
```js
|
20
|
+
var httpreq = require('httpreq');
|
21
|
+
|
22
|
+
httpreq.get('http://www.google.com', function (err, res) {
|
23
|
+
if (err) return console.log(err);
|
24
|
+
|
25
|
+
console.log(res.statusCode);
|
26
|
+
console.log(res.headers);
|
27
|
+
console.log(res.body);
|
28
|
+
console.log(res.cookies);
|
29
|
+
});
|
30
|
+
```
|
31
|
+
|
32
|
+
__Using await/async:__
|
33
|
+
|
34
|
+
```js
|
35
|
+
var httpreq = require('httpreq');
|
36
|
+
|
37
|
+
var res = await httpreq.get('http://www.google.com');
|
38
|
+
|
39
|
+
console.log(res.statusCode);
|
40
|
+
console.log(res.headers);
|
41
|
+
console.log(res.body);
|
42
|
+
console.log(res.cookies);
|
43
|
+
```
|
44
|
+
|
45
|
+
## Use with async/await
|
46
|
+
|
47
|
+
This module has been updated to support async/await.
|
48
|
+
|
49
|
+
In the following examples, simply omit the `callback` parameter and prepend it with `await`.
|
50
|
+
|
51
|
+
__Example:__
|
52
|
+
|
53
|
+
```js
|
54
|
+
var httpreq = require('httpreq');
|
55
|
+
|
56
|
+
var res = await httpreq.post('http://posttestserver.com/post.php', {
|
57
|
+
parameters: {
|
58
|
+
name: 'John',
|
59
|
+
lastname: 'Doe'
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
console.log(res.body);
|
64
|
+
```
|
65
|
+
|
66
|
+
## How to use
|
67
|
+
|
68
|
+
* [httpreq.get(url, [options], callback)](#get)
|
69
|
+
* [httpreq.post(url, [options], callback)](#post)
|
70
|
+
* [httpreq.put(url, [options], callback)](#put)
|
71
|
+
* [httpreq.delete(url, [options], callback)](#delete)
|
72
|
+
* [httpreq.options(url, [options], callback)](#options)
|
73
|
+
* [Uploading files](#upload)
|
74
|
+
* [Downloading a binary file](#binary)
|
75
|
+
* [Downloading a file directly to disk](#download)
|
76
|
+
* [Sending a custom body](#custombody)
|
77
|
+
* [Using a http(s) proxy](#proxy)
|
78
|
+
* [httpreq.doRequest(options, callback)](#dorequest)
|
79
|
+
|
80
|
+
---------------------------------------
|
81
|
+
### httpreq.get(url, [options], callback)
|
82
|
+
<a name="get"></a>
|
83
|
+
|
84
|
+
__Arguments__
|
85
|
+
- url: The url to connect to. Can be http or https.
|
86
|
+
- options: (all are optional) The following options can be passed:
|
87
|
+
- parameters: an object of query parameters
|
88
|
+
- headers: an object of headers
|
89
|
+
- cookies: an array of cookies
|
90
|
+
- auth: a string for basic authentication. For example `username:password`
|
91
|
+
- binary: true/false (default: false), if true, res.body will a buffer containing the binary data
|
92
|
+
- allowRedirects: (default: __true__ , only with httpreq.get() ), if true, redirects will be followed
|
93
|
+
- maxRedirects: (default: __10__ ). For example 1 redirect will allow for one normal request and 1 extra redirected request.
|
94
|
+
- timeout: (default: __none__ ). Adds a timeout to the http(s) request. Should be in milliseconds.
|
95
|
+
- proxy, if you want to pass your request through a http(s) proxy server:
|
96
|
+
- host: eg: "192.168.0.1"
|
97
|
+
- port: eg: 8888
|
98
|
+
- protocol: (default: __'http'__ ) can be 'http' or 'https'
|
99
|
+
- rejectUnauthorized: validate certificate for request with HTTPS. [More here](http://nodejs.org/api/https.html#https_https_request_options_callback)
|
100
|
+
- callback(err, res): A callback function which is called when the request is complete. __res__ contains the headers ( __res.headers__ ), the http status code ( __res.statusCode__ ) and the body ( __res.body__ )
|
101
|
+
|
102
|
+
__Example without options__
|
103
|
+
|
104
|
+
```js
|
105
|
+
var httpreq = require('httpreq');
|
106
|
+
|
107
|
+
httpreq.get('http://www.google.com', function (err, res){
|
108
|
+
if (err) return console.log(err);
|
109
|
+
|
110
|
+
console.log(res.statusCode);
|
111
|
+
console.log(res.headers);
|
112
|
+
console.log(res.body);
|
113
|
+
});
|
114
|
+
```
|
115
|
+
|
116
|
+
__Example with options__
|
117
|
+
|
118
|
+
```js
|
119
|
+
var httpreq = require('httpreq');
|
120
|
+
|
121
|
+
httpreq.get('http://posttestserver.com/post.php', {
|
122
|
+
parameters: {
|
123
|
+
name: 'John',
|
124
|
+
lastname: 'Doe'
|
125
|
+
},
|
126
|
+
headers:{
|
127
|
+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:18.0) Gecko/20100101 Firefox/18.0'
|
128
|
+
},
|
129
|
+
cookies: [
|
130
|
+
'token=DGcGUmplWQSjfqEvmu%2BZA%2Fc',
|
131
|
+
'id=2'
|
132
|
+
]
|
133
|
+
}, function (err, res){
|
134
|
+
if (err){
|
135
|
+
console.log(err);
|
136
|
+
}else{
|
137
|
+
console.log(res.body);
|
138
|
+
}
|
139
|
+
});
|
140
|
+
```
|
141
|
+
---------------------------------------
|
142
|
+
### httpreq.post(url, [options], callback)
|
143
|
+
<a name="post"></a>
|
144
|
+
|
145
|
+
__Arguments__
|
146
|
+
- url: The url to connect to. Can be http or https.
|
147
|
+
- options: (all are optional) The following options can be passed:
|
148
|
+
- parameters: an object of post parameters (content-type is set to *application/x-www-form-urlencoded; charset=UTF-8*)
|
149
|
+
- json: if you want to send json directly (content-type is set to *application/json*)
|
150
|
+
- files: an object of files to upload (content-type is set to *multipart/form-data; boundary=xxx*)
|
151
|
+
- body: custom body content you want to send. If used, previous options will be ignored and your custom body will be sent. (content-type will not be set)
|
152
|
+
- headers: an object of headers
|
153
|
+
- cookies: an array of cookies
|
154
|
+
- auth: a string for basic authentication. For example `username:password`
|
155
|
+
- binary: true/false (default: __false__ ), if true, res.body will be a buffer containing the binary data
|
156
|
+
- allowRedirects: (default: __false__ ), if true, redirects will be followed
|
157
|
+
- maxRedirects: (default: __10__ ). For example 1 redirect will allow for one normal request and 1 extra redirected request.
|
158
|
+
- encodePostParameters: (default: __true__ ), if true, POST/PUT parameters names will be URL encoded.
|
159
|
+
- timeout: (default: none). Adds a timeout to the http(s) request. Should be in milliseconds.
|
160
|
+
- proxy, if you want to pass your request through a http(s) proxy server:
|
161
|
+
- host: eg: "192.168.0.1"
|
162
|
+
- port: eg: 8888
|
163
|
+
- protocol: (default: __'http'__ ) can be 'http' or 'https'
|
164
|
+
- rejectUnauthorized: validate certificate for request with HTTPS. [More here](http://nodejs.org/api/https.html#https_https_request_options_callback)
|
165
|
+
- callback(err, res): A callback function which is called when the request is complete. __res__ contains the headers ( __res.headers__ ), the http status code ( __res.statusCode__ ) and the body ( __res.body__ )
|
166
|
+
|
167
|
+
__Example without extra options__
|
168
|
+
|
169
|
+
```js
|
170
|
+
var httpreq = require('httpreq');
|
171
|
+
|
172
|
+
httpreq.post('http://posttestserver.com/post.php', {
|
173
|
+
parameters: {
|
174
|
+
name: 'John',
|
175
|
+
lastname: 'Doe'
|
176
|
+
}
|
177
|
+
}, function (err, res){
|
178
|
+
if (err){
|
179
|
+
console.log(err);
|
180
|
+
}else{
|
181
|
+
console.log(res.body);
|
182
|
+
}
|
183
|
+
});
|
184
|
+
```
|
185
|
+
|
186
|
+
__Example with options__
|
187
|
+
|
188
|
+
```js
|
189
|
+
var httpreq = require('httpreq');
|
190
|
+
|
191
|
+
httpreq.post('http://posttestserver.com/post.php', {
|
192
|
+
parameters: {
|
193
|
+
name: 'John',
|
194
|
+
lastname: 'Doe'
|
195
|
+
},
|
196
|
+
headers:{
|
197
|
+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:18.0) Gecko/20100101 Firefox/18.0'
|
198
|
+
},
|
199
|
+
cookies: [
|
200
|
+
'token=DGcGUmplWQSjfqEvmu%2BZA%2Fc',
|
201
|
+
'id=2'
|
202
|
+
]
|
203
|
+
}, function (err, res){
|
204
|
+
if (err){
|
205
|
+
console.log(err);
|
206
|
+
}else{
|
207
|
+
console.log(res.body);
|
208
|
+
}
|
209
|
+
});
|
210
|
+
```
|
211
|
+
|
212
|
+
---------------------------------------
|
213
|
+
### httpreq.put(url, [options], callback)
|
214
|
+
<a name="put"></a>
|
215
|
+
|
216
|
+
Same options as [httpreq.post(url, [options], callback)](#post)
|
217
|
+
|
218
|
+
---------------------------------------
|
219
|
+
<a name="delete" />
|
220
|
+
### httpreq.delete(url, [options], callback)
|
221
|
+
|
222
|
+
Same options as [httpreq.post(url, [options], callback)](#post)
|
223
|
+
|
224
|
+
---------------------------------------
|
225
|
+
<a name="options" />
|
226
|
+
### httpreq.options(url, [options], callback)
|
227
|
+
|
228
|
+
Same options as [httpreq.get(url, [options], callback)](#get) except for the ability to follow redirects.
|
229
|
+
|
230
|
+
---------------------------------------
|
231
|
+
<a name="upload" />
|
232
|
+
### Uploading files
|
233
|
+
|
234
|
+
You can still use ```httpreq.uploadFiles({url: 'url', files: {}}, callback)```, but it's easier to just use POST (or PUT):
|
235
|
+
|
236
|
+
__Example__
|
237
|
+
|
238
|
+
```js
|
239
|
+
var httpreq = require('httpreq');
|
240
|
+
|
241
|
+
httpreq.post('http://posttestserver.com/upload.php', {
|
242
|
+
parameters: {
|
243
|
+
name: 'John',
|
244
|
+
lastname: 'Doe'
|
245
|
+
},
|
246
|
+
files:{
|
247
|
+
myfile: __dirname + "/testupload.jpg",
|
248
|
+
myotherfile: __dirname + "/testupload.jpg"
|
249
|
+
}
|
250
|
+
}, function (err, res){
|
251
|
+
if (err) throw err;
|
252
|
+
});
|
253
|
+
```
|
254
|
+
|
255
|
+
---------------------------------------
|
256
|
+
<a name="binary"></a>
|
257
|
+
### Downloading a binary file
|
258
|
+
To download a binary file, just add __binary: true__ to the options when doing a get or a post.
|
259
|
+
|
260
|
+
__Example__
|
261
|
+
|
262
|
+
```js
|
263
|
+
var httpreq = require('httpreq');
|
264
|
+
|
265
|
+
httpreq.get('https://ssl.gstatic.com/gb/images/k1_a31af7ac.png', {binary: true}, function (err, res){
|
266
|
+
if (err){
|
267
|
+
console.log(err);
|
268
|
+
}else{
|
269
|
+
fs.writeFile(__dirname + '/test.png', res.body, function (err) {
|
270
|
+
if(err)
|
271
|
+
console.log("error writing file");
|
272
|
+
});
|
273
|
+
}
|
274
|
+
});
|
275
|
+
```
|
276
|
+
|
277
|
+
---------------------------------------
|
278
|
+
<a name="download"></a>
|
279
|
+
### Downloading a file directly to disk
|
280
|
+
To download a file directly to disk, use the download method provided.
|
281
|
+
|
282
|
+
Downloading is done using a stream, so the data is not stored in memory and directly saved to file.
|
283
|
+
|
284
|
+
__Example__
|
285
|
+
|
286
|
+
```js
|
287
|
+
var httpreq = require('httpreq');
|
288
|
+
|
289
|
+
httpreq.download(
|
290
|
+
'https://ssl.gstatic.com/gb/images/k1_a31af7ac.png',
|
291
|
+
__dirname + '/test.png'
|
292
|
+
, function (err, progress){
|
293
|
+
if (err) return console.log(err);
|
294
|
+
console.log(progress);
|
295
|
+
}, function (err, res){
|
296
|
+
if (err) return console.log(err);
|
297
|
+
console.log(res);
|
298
|
+
});
|
299
|
+
|
300
|
+
```
|
301
|
+
|
302
|
+
When specifying the `progress` callback (3th parameter), you cannot use async/await.
|
303
|
+
|
304
|
+
---------------------------------------
|
305
|
+
<a name="custombody"></a>
|
306
|
+
### Sending a custom body
|
307
|
+
Use the body option to send a custom body (eg. an xml post)
|
308
|
+
|
309
|
+
__Example__
|
310
|
+
|
311
|
+
```js
|
312
|
+
var httpreq = require('httpreq');
|
313
|
+
|
314
|
+
httpreq.post('http://posttestserver.com/post.php',{
|
315
|
+
body: '<?xml version="1.0" encoding="UTF-8"?>',
|
316
|
+
headers:{
|
317
|
+
'Content-Type': 'text/xml',
|
318
|
+
}},
|
319
|
+
function (err, res) {
|
320
|
+
if (err){
|
321
|
+
console.log(err);
|
322
|
+
}else{
|
323
|
+
console.log(res.body);
|
324
|
+
}
|
325
|
+
}
|
326
|
+
);
|
327
|
+
```
|
328
|
+
|
329
|
+
---------------------------------------
|
330
|
+
<a name="proxy"></a>
|
331
|
+
### Using a http(s) proxy
|
332
|
+
|
333
|
+
__Example__
|
334
|
+
|
335
|
+
```js
|
336
|
+
var httpreq = require('httpreq');
|
337
|
+
|
338
|
+
httpreq.post('http://posttestserver.com/post.php', {
|
339
|
+
proxy: {
|
340
|
+
host: '10.100.0.126',
|
341
|
+
port: 8888
|
342
|
+
}
|
343
|
+
}, function (err, res){
|
344
|
+
if (err){
|
345
|
+
console.log(err);
|
346
|
+
}else{
|
347
|
+
console.log(res.body);
|
348
|
+
}
|
349
|
+
});
|
350
|
+
```
|
351
|
+
|
352
|
+
---------------------------------------
|
353
|
+
### httpreq.doRequest(options, callback)
|
354
|
+
<a name="dorequest"></a>
|
355
|
+
|
356
|
+
httpreq.doRequest is internally used by httpreq.get() and httpreq.post(). You can use this directly. Everything is stays the same as httpreq.get() or httpreq.post() except that the following options MUST be passed:
|
357
|
+
- url: the url to post the files to
|
358
|
+
- method: 'GET', 'POST', 'PUT' or 'DELETE'
|
359
|
+
|
360
|
+
## Run tests
|
361
|
+
|
362
|
+
Install all depedencies with
|
363
|
+
|
364
|
+
```bash
|
365
|
+
npm install
|
366
|
+
```
|
367
|
+
|
368
|
+
Install mocha with
|
369
|
+
|
370
|
+
```bash
|
371
|
+
npm install mocha -g
|
372
|
+
```
|
373
|
+
|
374
|
+
Run tests:
|
375
|
+
```bash
|
376
|
+
mocha test/tests.js
|
377
|
+
```
|
378
|
+
|
379
|
+
Run the async/await tests:
|
380
|
+
```bash
|
381
|
+
mocha test/tests-async.js
|
382
|
+
```
|
383
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
###### Contributors
|
2
|
+
[Sam](https://github.com/SamDecrock)
|
3
|
+
<font color="#999">63 Commits</font> / <font color="#6cc644">2309++</font> / <font color="#bd3c00"> 1040--</font>
|
4
|
+
<font color="#dedede">81.82% <font color="#dedede">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||</font><br><br>
|
5
|
+
[Franklin van de Meent](https://github.com/fvdm)
|
6
|
+
<font color="#999">8 Commits</font> / <font color="#6cc644">51++</font> / <font color="#bd3c00"> 16--</font>
|
7
|
+
<font color="#dedede">10.39% <font color="#dedede">||||||||||||||||||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
8
|
+
[Russell Beattie](https://github.com/russellbeattie)
|
9
|
+
<font color="#999">1 Commits</font> / <font color="#6cc644">55++</font> / <font color="#bd3c00"> 3--</font>
|
10
|
+
<font color="#dedede">01.30% <font color="#dedede">||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
11
|
+
[Jason Prickett MSFT](https://github.com/jpricketMSFT)
|
12
|
+
<font color="#999">1 Commits</font> / <font color="#6cc644">5++</font> / <font color="#bd3c00"> 0--</font>
|
13
|
+
<font color="#dedede">01.30% <font color="#dedede">||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
14
|
+
[null](https://github.com/jjharriso)
|
15
|
+
<font color="#999">1 Commits</font> / <font color="#6cc644">12++</font> / <font color="#bd3c00"> 0--</font>
|
16
|
+
<font color="#dedede">01.30% <font color="#dedede">||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
17
|
+
[MJJ](https://github.com/mjj2000)
|
18
|
+
<font color="#999">1 Commits</font> / <font color="#6cc644">11++</font> / <font color="#bd3c00"> 1--</font>
|
19
|
+
<font color="#dedede">01.30% <font color="#dedede">||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
20
|
+
[Jeff Young](https://github.com/jeffyoung)
|
21
|
+
<font color="#999">1 Commits</font> / <font color="#6cc644">19++</font> / <font color="#bd3c00"> 1--</font>
|
22
|
+
<font color="#dedede">01.30% <font color="#dedede">||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
23
|
+
[Dave Preston](https://github.com/davepreston)
|
24
|
+
<font color="#999">1 Commits</font> / <font color="#6cc644">5++</font> / <font color="#bd3c00"> 0--</font>
|
25
|
+
<font color="#dedede">01.30% <font color="#dedede">||</font><font color="#f4f4f4">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</font><br><br>
|
26
|
+
###### [Generated](https://github.com/jakeleboeuf/contributor) on Mon May 02 2016 11:08:45 GMT+0200 (CEST)
|