@readme/httpsnippet 2.4.5 → 3.0.1
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/README.md +19 -9
- package/package.json +24 -27
- package/src/helpers/code-builder.js +85 -80
- package/src/helpers/form-data.js +28 -26
- package/src/helpers/headers.js +18 -8
- package/src/helpers/reducer.js +10 -14
- package/src/index.js +175 -151
- package/src/targets/c/index.js +3 -5
- package/src/targets/c/libcurl.js +20 -25
- package/src/targets/clojure/clj_http.js +126 -102
- package/src/targets/clojure/index.js +3 -5
- package/src/targets/csharp/httpclient.js +93 -90
- package/src/targets/csharp/index.js +3 -5
- package/src/targets/csharp/restsharp.js +20 -22
- package/src/targets/go/index.js +3 -5
- package/src/targets/go/native.js +47 -54
- package/src/targets/http/http1.1.js +27 -37
- package/src/targets/http/index.js +3 -5
- package/src/targets/index.js +2 -4
- package/src/targets/java/asynchttp.js +22 -23
- package/src/targets/java/index.js +3 -5
- package/src/targets/java/nethttp.js +20 -24
- package/src/targets/java/okhttp.js +31 -31
- package/src/targets/java/unirest.js +22 -19
- package/src/targets/javascript/axios.js +47 -42
- package/src/targets/javascript/fetch.js +66 -68
- package/src/targets/javascript/index.js +3 -5
- package/src/targets/javascript/jquery.js +50 -44
- package/src/targets/javascript/xhr.js +48 -44
- package/src/targets/kotlin/index.js +3 -5
- package/src/targets/kotlin/okhttp.js +31 -31
- package/src/targets/node/axios.js +37 -34
- package/src/targets/node/fetch.js +94 -87
- package/src/targets/node/index.js +4 -5
- package/src/targets/node/native.js +51 -45
- package/src/targets/node/request.js +69 -69
- package/src/targets/node/unirest.js +70 -68
- package/src/targets/objc/helpers.js +32 -25
- package/src/targets/objc/index.js +3 -5
- package/src/targets/objc/nsurlsession.js +108 -79
- package/src/targets/ocaml/cohttp.js +32 -30
- package/src/targets/ocaml/index.js +3 -5
- package/src/targets/php/curl.js +86 -82
- package/src/targets/php/guzzle.js +135 -0
- package/src/targets/php/helpers.js +31 -29
- package/src/targets/php/http1.js +38 -49
- package/src/targets/php/http2.js +75 -75
- package/src/targets/php/index.js +5 -5
- package/src/targets/powershell/common.js +35 -30
- package/src/targets/powershell/index.js +3 -5
- package/src/targets/powershell/restmethod.js +3 -5
- package/src/targets/powershell/webrequest.js +3 -5
- package/src/targets/python/helpers.js +42 -37
- package/src/targets/python/index.js +4 -5
- package/src/targets/python/python3.js +33 -45
- package/src/targets/python/requests.js +48 -72
- package/src/targets/r/httr.js +60 -73
- package/src/targets/r/index.js +3 -5
- package/src/targets/ruby/index.js +3 -5
- package/src/targets/ruby/native.js +41 -35
- package/src/targets/shell/curl.js +108 -43
- package/src/{helpers/shell.js → targets/shell/helpers.js} +7 -9
- package/src/targets/shell/httpie.js +45 -39
- package/src/targets/shell/index.js +4 -5
- package/src/targets/shell/wget.js +20 -22
- package/src/targets/swift/helpers.js +44 -35
- package/src/targets/swift/index.js +3 -5
- package/src/targets/swift/nsurlsession.js +93 -79
- package/src/.DS_Store +0 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
1
|
module.exports = {
|
|
4
2
|
info: {
|
|
5
3
|
key: 'powershell',
|
|
6
4
|
title: 'Powershell',
|
|
7
5
|
extname: '.ps1',
|
|
8
|
-
default: 'webrequest'
|
|
6
|
+
default: 'webrequest',
|
|
9
7
|
},
|
|
10
8
|
|
|
11
9
|
webrequest: require('./webrequest'),
|
|
12
|
-
restmethod: require('./restmethod')
|
|
13
|
-
}
|
|
10
|
+
restmethod: require('./restmethod'),
|
|
11
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports = require('./common')('Invoke-RestMethod')
|
|
1
|
+
module.exports = require('./common')('Invoke-RestMethod');
|
|
4
2
|
|
|
5
3
|
module.exports.info = {
|
|
6
4
|
key: 'restmethod',
|
|
7
5
|
title: 'Invoke-RestMethod',
|
|
8
6
|
link: 'https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod',
|
|
9
|
-
description: 'Powershell Invoke-RestMethod client'
|
|
10
|
-
}
|
|
7
|
+
description: 'Powershell Invoke-RestMethod client',
|
|
8
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports = require('./common')('Invoke-WebRequest')
|
|
1
|
+
module.exports = require('./common')('Invoke-WebRequest');
|
|
4
2
|
|
|
5
3
|
module.exports.info = {
|
|
6
4
|
key: 'webrequest',
|
|
7
5
|
title: 'Invoke-WebRequest',
|
|
8
6
|
link: 'https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest',
|
|
9
|
-
description: 'Powershell Invoke-WebRequest client'
|
|
10
|
-
}
|
|
7
|
+
description: 'Powershell Invoke-WebRequest client',
|
|
8
|
+
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var util = require('util')
|
|
1
|
+
const { format } = require('util');
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Create an string of given length filled with blank spaces
|
|
@@ -9,26 +7,27 @@ var util = require('util')
|
|
|
9
7
|
* @param {string} str String to pad out with
|
|
10
8
|
* @return {string}
|
|
11
9
|
*/
|
|
12
|
-
function buildString
|
|
13
|
-
|
|
10
|
+
function buildString(length, str) {
|
|
11
|
+
// eslint-disable-next-line prefer-spread
|
|
12
|
+
return Array.apply(null, new Array(length)).map(String.prototype.valueOf, str).join('');
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Create a string corresponding to a Dictionary or Array literal representation with pretty option
|
|
18
17
|
* and indentation.
|
|
19
18
|
*/
|
|
20
|
-
function concatValues
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
function concatValues(concatType, values, pretty, indentation, indentLevel) {
|
|
20
|
+
const currentIndent = buildString(indentLevel, indentation);
|
|
21
|
+
const closingBraceIndent = buildString(indentLevel - 1, indentation);
|
|
22
|
+
const join = pretty ? `,\n${currentIndent}` : ', ';
|
|
23
|
+
const openingBrace = concatType === 'object' ? '{' : '[';
|
|
24
|
+
const closingBrace = concatType === 'object' ? '}' : ']';
|
|
26
25
|
|
|
27
26
|
if (pretty) {
|
|
28
|
-
return openingBrace
|
|
29
|
-
} else {
|
|
30
|
-
return openingBrace + values.join(join) + closingBrace
|
|
27
|
+
return `${openingBrace}\n${currentIndent}${values.join(join)}\n${closingBraceIndent}${closingBrace}`;
|
|
31
28
|
}
|
|
29
|
+
|
|
30
|
+
return openingBrace + values.join(join) + closingBrace;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
module.exports = {
|
|
@@ -40,41 +39,47 @@ module.exports = {
|
|
|
40
39
|
* @return {string}
|
|
41
40
|
*/
|
|
42
41
|
literalRepresentation: function (value, opts, indentLevel) {
|
|
43
|
-
|
|
42
|
+
// eslint-disable-next-line no-param-reassign
|
|
43
|
+
indentLevel = indentLevel === undefined ? 1 : indentLevel + 1;
|
|
44
44
|
|
|
45
45
|
switch (Object.prototype.toString.call(value)) {
|
|
46
46
|
case '[object Number]':
|
|
47
|
-
return value
|
|
47
|
+
return value;
|
|
48
48
|
|
|
49
|
-
case '[object Array]':
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
case '[object Array]': {
|
|
50
|
+
let pretty = false;
|
|
51
|
+
const valuesRepresentation = value.map(
|
|
52
|
+
function (v) {
|
|
53
|
+
// Switch to prettify if the value is a dictionary with multiple keys
|
|
54
|
+
if (Object.prototype.toString.call(v) === '[object Object]') {
|
|
55
|
+
pretty = Object.keys(v).length > 1;
|
|
56
|
+
}
|
|
57
|
+
return this.literalRepresentation(v, opts, indentLevel);
|
|
58
|
+
}.bind(this)
|
|
59
|
+
);
|
|
60
|
+
return concatValues('array', valuesRepresentation, pretty, opts.indent, indentLevel);
|
|
61
|
+
}
|
|
59
62
|
|
|
60
|
-
case '[object Object]':
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
case '[object Object]': {
|
|
64
|
+
const keyValuePairs = [];
|
|
65
|
+
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
66
|
+
for (const k in value) {
|
|
67
|
+
keyValuePairs.push(format('"%s": %s', k, this.literalRepresentation(value[k], opts, indentLevel)));
|
|
64
68
|
}
|
|
65
|
-
return concatValues('object', keyValuePairs, opts.pretty && keyValuePairs.length > 1, opts.indent, indentLevel)
|
|
69
|
+
return concatValues('object', keyValuePairs, opts.pretty && keyValuePairs.length > 1, opts.indent, indentLevel);
|
|
70
|
+
}
|
|
66
71
|
|
|
67
72
|
case '[object Null]':
|
|
68
|
-
return 'None'
|
|
73
|
+
return 'None';
|
|
69
74
|
|
|
70
75
|
case '[object Boolean]':
|
|
71
|
-
return value ? 'True' : 'False'
|
|
76
|
+
return value ? 'True' : 'False';
|
|
72
77
|
|
|
73
78
|
default:
|
|
74
79
|
if (value === null || value === undefined) {
|
|
75
|
-
return ''
|
|
80
|
+
return '';
|
|
76
81
|
}
|
|
77
|
-
return
|
|
82
|
+
return `"${value.toString().replace(/"/g, '\\"')}"`;
|
|
78
83
|
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
1
|
module.exports = {
|
|
4
2
|
info: {
|
|
5
3
|
key: 'python',
|
|
6
4
|
title: 'Python',
|
|
7
5
|
extname: '.py',
|
|
8
|
-
default: 'python3'
|
|
6
|
+
default: 'python3',
|
|
7
|
+
cli: 'python3 %s',
|
|
9
8
|
},
|
|
10
9
|
|
|
11
10
|
python3: require('./python3'),
|
|
12
|
-
requests: require('./requests')
|
|
13
|
-
}
|
|
11
|
+
requests: require('./requests'),
|
|
12
|
+
};
|
|
@@ -8,85 +8,73 @@
|
|
|
8
8
|
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const CodeBuilder = require('../../helpers/code-builder');
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
module.exports = function (source, options) {
|
|
16
|
-
var code = new CodeBuilder()
|
|
13
|
+
module.exports = function (source) {
|
|
14
|
+
const code = new CodeBuilder();
|
|
17
15
|
// Start Request
|
|
18
|
-
code.push('import http.client')
|
|
19
|
-
.blank()
|
|
16
|
+
code.push('import http.client').blank();
|
|
20
17
|
|
|
21
18
|
// Check which protocol to be used for the client connection
|
|
22
|
-
|
|
19
|
+
const protocol = source.uriObj.protocol;
|
|
23
20
|
if (protocol === 'https:') {
|
|
24
|
-
code.push('conn = http.client.HTTPSConnection("%s")', source.uriObj.host)
|
|
25
|
-
.blank()
|
|
21
|
+
code.push('conn = http.client.HTTPSConnection("%s")', source.uriObj.host).blank();
|
|
26
22
|
} else {
|
|
27
|
-
code.push('conn = http.client.HTTPConnection("%s")', source.uriObj.host)
|
|
28
|
-
.blank()
|
|
23
|
+
code.push('conn = http.client.HTTPConnection("%s")', source.uriObj.host).blank();
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
// Create payload string if it exists
|
|
32
|
-
|
|
27
|
+
const payload = JSON.stringify(source.postData.text);
|
|
33
28
|
if (payload) {
|
|
34
|
-
code.push('payload = %s', payload)
|
|
35
|
-
.blank()
|
|
29
|
+
code.push('payload = %s', payload).blank();
|
|
36
30
|
}
|
|
37
31
|
|
|
38
32
|
// Create Headers
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var headerCount = Object.keys(headers).length
|
|
33
|
+
const headers = source.allHeaders;
|
|
34
|
+
const headerCount = Object.keys(headers).length;
|
|
42
35
|
if (headerCount === 1) {
|
|
43
|
-
|
|
44
|
-
code.push('headers = { \'%s\': "%s" }', header, headers[header])
|
|
45
|
-
|
|
46
|
-
}
|
|
36
|
+
Object.keys(headers).forEach(header => {
|
|
37
|
+
code.push('headers = { \'%s\': "%s" }', header, headers[header]).blank();
|
|
38
|
+
});
|
|
47
39
|
} else if (headerCount > 1) {
|
|
48
|
-
|
|
40
|
+
let count = 1;
|
|
49
41
|
|
|
50
|
-
code.push('headers = {')
|
|
42
|
+
code.push('headers = {');
|
|
51
43
|
|
|
52
|
-
|
|
44
|
+
Object.keys(headers).forEach(header => {
|
|
45
|
+
// eslint-disable-next-line no-plusplus
|
|
53
46
|
if (count++ !== headerCount) {
|
|
54
|
-
code.push(' \'%s\': "%s",', header, headers[header])
|
|
47
|
+
code.push(' \'%s\': "%s",', header, headers[header]);
|
|
55
48
|
} else {
|
|
56
|
-
code.push(' \'%s\': "%s"', header, headers[header])
|
|
49
|
+
code.push(' \'%s\': "%s"', header, headers[header]);
|
|
57
50
|
}
|
|
58
|
-
}
|
|
51
|
+
});
|
|
59
52
|
|
|
60
|
-
code.push(' }')
|
|
61
|
-
.blank()
|
|
53
|
+
code.push(' }').blank();
|
|
62
54
|
}
|
|
63
55
|
|
|
64
56
|
// Make Request
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
const method = source.method;
|
|
58
|
+
const path = source.uriObj.path;
|
|
67
59
|
if (payload && headerCount) {
|
|
68
|
-
code.push('conn.request("%s", "%s", payload, headers)', method, path)
|
|
60
|
+
code.push('conn.request("%s", "%s", payload, headers)', method, path);
|
|
69
61
|
} else if (payload && !headerCount) {
|
|
70
|
-
code.push('conn.request("%s", "%s", payload)', method, path)
|
|
62
|
+
code.push('conn.request("%s", "%s", payload)', method, path);
|
|
71
63
|
} else if (!payload && headerCount) {
|
|
72
|
-
code.push('conn.request("%s", "%s", headers=headers)', method, path)
|
|
64
|
+
code.push('conn.request("%s", "%s", headers=headers)', method, path);
|
|
73
65
|
} else {
|
|
74
|
-
code.push('conn.request("%s", "%s")', method, path)
|
|
66
|
+
code.push('conn.request("%s", "%s")', method, path);
|
|
75
67
|
}
|
|
76
68
|
|
|
77
69
|
// Get Response
|
|
78
|
-
code.blank()
|
|
79
|
-
.push('res = conn.getresponse()')
|
|
80
|
-
.push('data = res.read()')
|
|
81
|
-
.blank()
|
|
82
|
-
.push('print(data.decode("utf-8"))')
|
|
70
|
+
code.blank().push('res = conn.getresponse()').push('data = res.read()').blank().push('print(data.decode("utf-8"))');
|
|
83
71
|
|
|
84
|
-
return code.join()
|
|
85
|
-
}
|
|
72
|
+
return code.join();
|
|
73
|
+
};
|
|
86
74
|
|
|
87
75
|
module.exports.info = {
|
|
88
76
|
key: 'python3',
|
|
89
77
|
title: 'http.client',
|
|
90
78
|
link: 'https://docs.python.org/3/library/http.client.html',
|
|
91
|
-
description: 'Python3 HTTP Client'
|
|
92
|
-
}
|
|
79
|
+
description: 'Python3 HTTP Client',
|
|
80
|
+
};
|
|
@@ -8,118 +8,94 @@
|
|
|
8
8
|
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var CodeBuilder = require('../../helpers/code-builder')
|
|
15
|
-
var helpers = require('./helpers')
|
|
11
|
+
const { format } = require('util');
|
|
12
|
+
const CodeBuilder = require('../../helpers/code-builder');
|
|
13
|
+
const helpers = require('./helpers');
|
|
16
14
|
|
|
17
15
|
module.exports = function (source, options) {
|
|
18
|
-
|
|
16
|
+
const opts = {
|
|
19
17
|
indent: ' ',
|
|
20
|
-
pretty: true
|
|
21
|
-
|
|
18
|
+
pretty: true,
|
|
19
|
+
...options,
|
|
20
|
+
};
|
|
22
21
|
|
|
23
22
|
// Start snippet
|
|
24
|
-
|
|
23
|
+
const code = new CodeBuilder(opts.indent);
|
|
25
24
|
|
|
26
25
|
// Import requests
|
|
27
|
-
code.push('import requests')
|
|
28
|
-
.blank()
|
|
26
|
+
code.push('import requests').blank();
|
|
29
27
|
|
|
30
28
|
// Set URL
|
|
31
|
-
code.push('url = "%s"', source.
|
|
32
|
-
.blank()
|
|
33
|
-
|
|
34
|
-
// Construct query string
|
|
35
|
-
if (Object.keys(source.queryObj).length) {
|
|
36
|
-
var qs = 'querystring = ' + JSON.stringify(source.queryObj)
|
|
37
|
-
|
|
38
|
-
code.push(qs)
|
|
39
|
-
.blank()
|
|
40
|
-
}
|
|
29
|
+
code.push('url = "%s"', source.fullUrl).blank();
|
|
41
30
|
|
|
42
31
|
// Construct payload
|
|
43
|
-
let hasPayload = false
|
|
44
|
-
let jsonPayload = false
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
code.push('payload = %s', payload)
|
|
58
|
-
hasPayload = true
|
|
59
|
-
}
|
|
32
|
+
let hasPayload = false;
|
|
33
|
+
let jsonPayload = false;
|
|
34
|
+
if (source.postData.mimeType === 'application/json') {
|
|
35
|
+
if (source.postData.jsonObj) {
|
|
36
|
+
code.push('payload = %s', helpers.literalRepresentation(source.postData.jsonObj, opts));
|
|
37
|
+
jsonPayload = true;
|
|
38
|
+
hasPayload = true;
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
const payload = JSON.stringify(source.postData.text);
|
|
42
|
+
if (payload) {
|
|
43
|
+
code.push('payload = %s', payload);
|
|
44
|
+
hasPayload = true;
|
|
45
|
+
}
|
|
60
46
|
}
|
|
61
47
|
|
|
62
48
|
// Construct headers
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var headerCount = Object.keys(headers).length
|
|
49
|
+
const headers = source.allHeaders;
|
|
50
|
+
const headerCount = Object.keys(headers).length;
|
|
66
51
|
|
|
67
52
|
if (headerCount === 1) {
|
|
68
|
-
|
|
69
|
-
code.push('headers = {"%s": "%s"}', header, headers[header])
|
|
70
|
-
|
|
71
|
-
}
|
|
53
|
+
Object.keys(headers).forEach(header => {
|
|
54
|
+
code.push('headers = {"%s": "%s"}', header, headers[header]).blank();
|
|
55
|
+
});
|
|
72
56
|
} else if (headerCount > 1) {
|
|
73
|
-
|
|
57
|
+
let count = 1;
|
|
74
58
|
|
|
75
|
-
code.push('headers = {')
|
|
59
|
+
code.push('headers = {');
|
|
76
60
|
|
|
77
|
-
|
|
61
|
+
Object.keys(headers).forEach(header => {
|
|
62
|
+
// eslint-disable-next-line no-plusplus
|
|
78
63
|
if (count++ !== headerCount) {
|
|
79
|
-
code.push(1, '"%s": "%s",', header, headers[header])
|
|
64
|
+
code.push(1, '"%s": "%s",', header, headers[header]);
|
|
80
65
|
} else {
|
|
81
|
-
code.push(1, '"%s": "%s"', header, headers[header])
|
|
66
|
+
code.push(1, '"%s": "%s"', header, headers[header]);
|
|
82
67
|
}
|
|
83
|
-
}
|
|
68
|
+
});
|
|
84
69
|
|
|
85
|
-
code.push('}')
|
|
86
|
-
.blank()
|
|
70
|
+
code.push('}').blank();
|
|
87
71
|
}
|
|
88
72
|
|
|
89
73
|
// Construct request
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
const method = source.method;
|
|
75
|
+
let request = format('response = requests.request("%s", url', method);
|
|
92
76
|
|
|
93
77
|
if (hasPayload) {
|
|
94
78
|
if (jsonPayload) {
|
|
95
|
-
request += ', json=payload'
|
|
79
|
+
request += ', json=payload';
|
|
96
80
|
} else {
|
|
97
|
-
request += ', data=payload'
|
|
81
|
+
request += ', data=payload';
|
|
98
82
|
}
|
|
99
83
|
}
|
|
100
84
|
|
|
101
85
|
if (headerCount > 0) {
|
|
102
|
-
request += ', headers=headers'
|
|
86
|
+
request += ', headers=headers';
|
|
103
87
|
}
|
|
104
88
|
|
|
105
|
-
|
|
106
|
-
request += ', params=querystring'
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
request += ')'
|
|
110
|
-
|
|
111
|
-
code.push(request)
|
|
112
|
-
.blank()
|
|
89
|
+
request += ')';
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
.push('print(response.text)')
|
|
91
|
+
code.push(request).blank().push('print(response.text)');
|
|
116
92
|
|
|
117
|
-
return code.join()
|
|
118
|
-
}
|
|
93
|
+
return code.join();
|
|
94
|
+
};
|
|
119
95
|
|
|
120
96
|
module.exports.info = {
|
|
121
97
|
key: 'requests',
|
|
122
98
|
title: 'Requests',
|
|
123
99
|
link: 'http://docs.python-requests.org/en/latest/api/#requests.request',
|
|
124
|
-
description: 'Requests HTTP library'
|
|
125
|
-
}
|
|
100
|
+
description: 'Requests HTTP library',
|
|
101
|
+
};
|