forked from vdespa/write-write-response
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollection.json
More file actions
93 lines (93 loc) · 1.82 KB
/
collection.json
File metadata and controls
93 lines (93 loc) · 1.82 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
"info": {
"_postman_id": "cb2512f0-1e26-48e1-ad6d-26ddda278c72",
"name": "Write response to file",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get data",
"event": [
{
"listen": "test",
"script": {
"id": "77bcfcd7-12d5-4ed0-94ea-0a1b7e1a9b53",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"/*",
"const fs = require('fs');",
"",
"fs.writeFile('response.txt', pm.response.text(), function (error) {",
" if (error) { ",
" console.error(error); ",
" }",
"});",
"*/"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "httpbin.org/get",
"host": [
"httpbin",
"org"
],
"path": [
"get"
]
}
},
"response": []
},
{
"name": "Send data",
"event": [
{
"listen": "test",
"script": {
"id": "8fee26ba-810d-424f-920c-dee070b83601",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"{{$randomFullName}}\",\n \"company\": \"{{$randomCompanyName}}\",\n \"phone\": \"{{$randomPhoneNumber}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "httpbin.org/post",
"host": [
"httpbin",
"org"
],
"path": [
"post"
]
}
},
"response": []
}
],
"protocolProfileBehavior": {}
}