-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
36 lines (29 loc) · 948 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { request } = require('./index')
request({
url: 'https://example.com/',
proxy: {
host: '<proxy-host>',
port: '<proxy-port>',
username: '<proxy-username>',
password: '<proxy-password>'
},
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
},
method: 'GET'
}).then(console.log).catch(console.error)
request({
url: 'https://example.com/',
proxy: {
host: '<proxy-host>',
port: '<proxy-port>',
username: '<proxy-username>',
password: '<proxy-password>'
},
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
"Content-Type": "application/json"
},
method: 'POST',
body: { a: 1 }
}).then(console.log).catch(console.error)