{"id":376808,"date":"2024-05-22T15:01:37","date_gmt":"2024-05-22T15:01:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=376808"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-22T15:01:37","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=376808","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 Postman \u0447\u0435\u0440\u0435\u0437 pre-request<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430 \u2014 \u00ab\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c \u0441\u0435\u0431\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0430\u043c. \u041d\u0435 \u043d\u0430\u0434\u0435\u0439\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442\u00bb. \u0422\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435, \u0434\u0430\u0436\u0435 \u043f\u0443\u0441\u0442\u043e\u043c. \u0421\u0430\u043c \u0441\u0435\u0431\u0435 \u0432\u0441\u0451 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b, \u043f\u0440\u043e\u0433\u043d\u0430\u043b \u0442\u0435\u0441\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u0435\u0449\u0451 \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0437\u0430 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/26e\/e93\/30f\/26ee9330f102760ef9042b297ce06c7e.png\" width=\"500\" height=\"386\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26e\/e93\/30f\/26ee9330f102760ef9042b297ce06c7e.png\"\/><\/figure>\n<p>\u0412 Postman \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430. \u0423\u0434\u043e\u0431\u043d\u043e \u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0430 \u043e\u043d \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0445\u043e\u0442\u044c \u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u0435, \u0445\u043e\u0442\u044c \u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e pm.sendRequest() \u0432 pre-request \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0443 \u0432 \u0441\u0442\u0438\u043b\u0435 \u00ab\u0431\u0435\u0440\u0438 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0439\u00bb \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 <a href=\"https:\/\/okiseleva.blogspot.com\/2017\/04\/users-soap-rest.html\" rel=\"noopener noreferrer nofollow\"><u>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Users<\/u><\/a>.<\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<ol>\n<li>\n<p><a href=\"#one_req\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 pre-request<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#two_req\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 pre-request<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#itogo\" rel=\"noopener noreferrer nofollow\">\u0418\u0442\u043e\u0433\u043e<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"one_req\" id=\"one_req\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 pre-request<\/h3>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/learning.postman.com\/docs\/tests-and-scripts\/write-scripts\/postman-sandbox-api-reference\/#sending-requests-from-scripts\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a>). \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 postRequest, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e sendRequest:<\/p>\n<pre><code class=\"json\">\/\/ Example with a full-fledged request  const postRequest = { \u00a0\u00a0url: 'https:\/\/postman-echo.com\/post', \u00a0\u00a0method: 'POST', \u00a0\u00a0header: { \u00a0\u00a0\u00a0\u00a0'Content-Type': 'application\/json', \u00a0\u00a0\u00a0\u00a0'X-Foo': 'bar' \u00a0\u00a0}, \u00a0\u00a0body: { \u00a0\u00a0\u00a0\u00a0mode: 'raw', \u00a0\u00a0\u00a0\u00a0raw: JSON.stringify({ key: 'this is json' }) \u00a0\u00a0} };  pm.sendRequest(postRequest, (error, response) => { \u00a0\u00a0console.log(error ? error : response.json()); });<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 Users. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 getUser \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 <em>(\u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 Postman, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u0438\u0434\u0435\u043e \u00ab<\/em><a href=\"https:\/\/youtu.be\/U7-8ZmCBiPI\" rel=\"noopener noreferrer nofollow\"><em><u>\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c REST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442<\/u><\/em><\/a><em>\u00bb \u0438 \u0441\u0442\u0430\u0442\u044c\u044e<\/em> <em>\u00ab<\/em><a href=\"https:\/\/habr.com\/ru\/articles\/554274\/\" rel=\"noopener noreferrer nofollow\"><em>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 JSON<\/em><\/a><em>\u00bb)<\/em>:<\/p>\n<pre><code class=\"json\">\u0422\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 POST URL \u2014 http:\/\/users.bugred.ru\/tasks\/rest\/getuser\u00a0  Body \u0432 json:  {  \u00a0\u00a0\"email\": \"test_habr_1@mail.com\"  }\u00a0<\/code><\/pre>\n<p>\u041d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c. \u0410 \u043f\u043e\u043a\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443: \u00ab\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u00bb<em> (\u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0439\u0442\u0438 \u0448\u0430\u0433\u0438 \u0441 \u043d\u0443\u043b\u044f, \u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 email, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043a\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0435\u0442\u0443)<\/em>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2f5\/68f\/2d8\/2f568f2d8b6bfdb5a9d18a4110ed6e00.png\" width=\"1600\" height=\"879\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f5\/68f\/2d8\/2f568f2d8b6bfdb5a9d18a4110ed6e00.png\"\/><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.\u00a0<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c \u2014\u00a0\u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 doregister. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u043d\u0435 pre-request, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"json\">\u0422\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 POST URL \u2014 http:\/\/users.bugred.ru\/tasks\/rest\/doregister\u00a0  Body \u0432 json:  { \u00a0\u00a0\u00a0\u00a0\"name\": \"\u0425\u0430\u0431\u0440 1\", \u00a0\u00a0\u00a0\u00a0\"email\": \"test_habr_1@mail.com\", \u00a0\u00a0\u00a0\u00a0\"password\": \"1\" }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u0432 pre-request:<\/p>\n<pre><code class=\"json\">const postRequest = { \u00a0\u00a0url: 'http:\/\/users.bugred.ru\/tasks\/rest\/doregister', \u00a0\u00a0method: 'POST', \u00a0\u00a0body: { \u00a0\u00a0\u00a0\u00a0mode: 'raw', \u00a0\u00a0\u00a0\u00a0raw: JSON.stringify({\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0email: \"test_habr_1@mail.com\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: \"\u0425\u0430\u0431\u0440 1\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0password: 1 \u00a0\u00a0\u00a0\u00a0}) \u00a0\u00a0} };   pm.sendRequest(postRequest, function (err, res) { \u00a0\u00a0console.log(err ? err : res.json().message); });<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00ab<strong>Scripts \u2192 Pre-request\u00bb<\/strong> \u0438 \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u00abSend\u00bb. \u0418 \u0432\u0443\u0430\u043b\u044f, \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd0\/b6b\/be7\/bd0b6bbe785b02d62dea1c882243830d.png\" width=\"1600\" height=\"1153\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bd0\/b6b\/be7\/bd0b6bbe785b02d62dea1c882243830d.png\"\/><\/figure>\n<p>\u041d\u043e \u043f\u043e\u0441\u0442\u043e\u0439\u0442\u0435\u2026 \u0410 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044e \u0437\u0430\u043f\u0440\u043e\u0441? \u0418 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 pre-request \u0443\u043f\u0430\u0434\u0435\u0442? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c!<\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u2014\u00a0\u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0410 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441 pre-request? \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0451:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4d9\/7e5\/a8e\/4d97e5a8e6e2a9d75457c1e4d87062a6.png\" width=\"1600\" height=\"579\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4d9\/7e5\/a8e\/4d97e5a8e6e2a9d75457c1e4d87062a6.png\"\/><\/figure>\n<p>\u0418 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434 doregister, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0443\u043b \u0432 Body \u043e\u0448\u0438\u0431\u043a\u0443 \u00abemail \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442\u00bb, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0448\u0435\u043b \u0432\u044b\u0437\u043e\u0432 getuser. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u0437\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 pre-request\u2026 \u0418\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9e8\/6af\/e3f\/9e86afe3f3261ff1005b9b85fc69b974.png\" width=\"794\" height=\"218\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e8\/6af\/e3f\/9e86afe3f3261ff1005b9b85fc69b974.png\"\/><\/figure>\n<p>Users \u2014 \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430 <u>\u043b\u044e\u0431\u043e\u0439<\/u> \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0435\u0431\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u043a\u043e\u0434 200. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0434\u0435\u0440\u0433\u0430\u044f doregister \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c URL, \u0443\u0434\u0430\u043b\u0438\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0431\u0443\u043a\u0432\u0443 \u2014 <em>url: &#8216;http:\/\/users.bugred.ru\/tasks\/rest\/doregiste&#8217;<\/em><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 GET (\u0430 \u0442\u0430\u043c \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 POST \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f)<\/p>\n<\/li>\n<li>\n<p>\u2026<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u00ab200 \u041e\u041a\u00bb. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u0441\u0451 \u0436\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 URL \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0435, \u0434\u0440\u0443\u0433\u043e\u0435 API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u0410 \u0442\u0435\u043b\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0442 Users, \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430 \u043d\u0435\u043c \u0438 \u0441\u0432\u0430\u043b\u0438\u0442\u0441\u044f.<\/p>\n<p>\u042f \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0430 URL \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 JIRA \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (<em>postRequest2<\/em>). \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0432 pre-request \u0442\u0430\u043a\u043e\u0439 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430:\u00a0<\/p>\n<pre><code class=\"json\">const postRequest2 = { \u00a0\u00a0url: 'https:\/\/testbase.atlassian.net\/rest\/api\/3\/issue\/TEST-18750', \u00a0\u00a0method: 'POST', \u00a0\u00a0body: { \u00a0\u00a0\u00a0\u00a0mode: 'raw', \u00a0\u00a0\u00a0\u00a0raw: JSON.stringify({ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0email: \"test_habr_1@mail.com\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: \"\u0425\u0430\u0431\u0440 1\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0password: 1 \u00a0\u00a0\u00a0\u00a0}) \u00a0\u00a0} };  pm.sendRequest(postRequest2, function (err, res) { \u00a0\u00a0console.log(err ? err : res.json().message); });<\/code><\/pre>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0430\u0433\u0430, \u043e\u0448\u0438\u0431\u043e\u0447\u043a\u0430!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e0b\/93d\/d3d\/e0b93dd3db1e9357ddd531770de49a79.png\" width=\"1600\" height=\"872\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e0b\/93d\/d3d\/e0b93dd3db1e9357ddd531770de49a79.png\"\/><\/figure>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0443\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Glossary\/Idempotent\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u0434\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u00ab\u0442\u0430\u043a\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0431\u0430\u0437\u0435\u00bb, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0432\u043e \u0432\u0441\u044f\u043a\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u00ab\u0435\u0441\u043b\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c, \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u0439\u2026\u00bb.\u00a0<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c pre-request \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435. \u0418 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0441 \u043d\u0438\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0418 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0436\u0435 \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c!<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"two_req\" id=\"two_req\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 pre-request<\/h3>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>getUser<\/em>. \u0423 \u043d\u0435\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u2014 \u0432\u043e\u0442 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043e\u043d\u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u044e\u0437\u0435\u0440\u0435. \u0410 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0432 Users \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>createuser<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0437\u0430 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441. \u041d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435\u0442. \u0418 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <em>doregister<\/em>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0447\u0435\u0440\u0435\u0437 <em>fullupdateuser<\/em>.<\/p>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u043a\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c 2 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434\u0440\u044f\u0434:<\/p>\n<pre><code class=\"json\">pm.sendRequest(req1, done); pm.sendRequest(req2, done);<\/code><\/pre>\n<p>\u041d\u043e \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <em>pm.sendRequests<\/em> \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u043e\u0431\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0436\u0438\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 req1, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c req2. \u0418 \u0442\u043e\u0433\u0434\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f, \u0432\u0435\u0434\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0435\u0449\u0451 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d, \u043a\u043e\u0433\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c?<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 req2 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f req1, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 sendRequest \u043f\u043e req1 (<a href=\"https:\/\/community.postman.com\/t\/can-i-use-pm-sendrequest-to-send-requests-synchronously\/225\/4\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430<\/u><\/a>):<\/p>\n<pre><code class=\"json\">pm.sendRequest(req1, function () { \u00a0\u00a0pm.sendRequest(req2, done); });<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c! \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c pre-request \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"json\">const req_1_create = {   url: 'http:\/\/users.bugred.ru\/tasks\/rest\/doregister',   method: 'POST',   body: {     mode: 'raw',     raw: JSON.stringify({          email: \"test_habr_1@mail.com\",         name: \"\u0425\u0430\u0431\u0440 1\",         password: 1     })   } };  const req_2_update = {   url: 'http:\/\/users.bugred.ru\/tasks\/rest\/fullupdateuser',   method: 'POST',   body: {     mode: 'raw',     raw: JSON.stringify({          email: \"test_habr_1@mail.com\",         name: \"\u0412\u0430\u0441\u0435\u043d\u044c\u043a\u0430\",         birthday: \"01.01.1900\",         gender: \"m\",         date_start: \"11.11.2000\",         hobby: \"\u0412\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0438\u0432\u0430\u043d\u0435\",         name1: \"\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439, \u044f\u0441\u0435\u043d \u043f\u0435\u043d\u044c\",         surname1: \"\u0418\u0432\u0430\u043d\u043e\u0432\",         fathername1: \"\u041f\u0435\u0442\u0440\u043e\u0432\",         cat: \"\u041c\u0430\u0440\u0443\u0441\u044f\",         dog: \"\u0423\u0448\u0430\u0441\u0442\u044b\u0439\",         parrot: \"\u0412\u0430\u0441\u044c\u043a\u0430\",         cavy: \"\u041a\u0442\u043e \u0442\u044b?\",         hamster: \"\u0425\u043e\u043c\u044f\u043a\",         squirrel: \"\u0411\u0435\u043b\u0430\u044f \u0433\u043e\u0440\u044f\u0447\u043a\u0430 \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u0430\",         phone: \"333 33 33\",         adres: \"\u0430\u0434\u0440\u0435\u0441 1\",         inn: \"123456789012\"     })   } };  pm.sendRequest(req_1_create, function () {   pm.sendRequest(req_2_update, function (err, res) {   console.log(err ? err : res.json().message); }) });<\/code><\/pre>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0434\u0430! \u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0438\u043c\u044f \u00ab\u0412\u0430\u0441\u0435\u043d\u044c\u043a\u0430\u00bb, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/193\/734\/771\/193734771fcfbee9234db7a3b2e10cbf.png\" width=\"1600\" height=\"1154\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/193\/734\/771\/193734771fcfbee9234db7a3b2e10cbf.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"itogo\" id=\"itogo\"><\/a><\/p>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<p>\u0412 Postman \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0432\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 API. \u041e\u0434\u043d\u0430 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 <em>pm.sendRequest()<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>\u041e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u00ab\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u00bb \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b \u0438 \u043d\u0435 \u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043d\u0435 \u043d\u0430\u0434\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043b\u043e\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443 \u00ab\u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b?\u00bb.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e (\u043f\u0430\u043f\u043a\u0443 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c, \u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u0435\u0451. \u0410 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>pm.sendRequest()<\/em> \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0414\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0432\u044b\u0431\u043e\u0440 \u0437\u0430 \u0432\u0430\u043c\u0438.<\/p>\n<p>\u041d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <em>sendRequest<\/em>, \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u2014\u00a0\u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430! \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"json\">pm.sendRequest(req_1, function () { \u00a0\u00a0pm.sendRequest(req_2, function (err, res) { \u00a0\u00a0console.log(err ? err : res.json().message); }) })<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0451, \u0443\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 =)<\/p>\n<p><em>PS \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438\u0449\u0438\u0442\u0435 <\/em><a href=\"https:\/\/okiseleva.blogspot.com\/search\/label\/%D0%BF%D0%BE%D0%BB%D0%B5%D0%B7%D0%BD%D0%BE%D0%B5\" rel=\"noopener noreferrer nofollow\"><em><u>\u0432 \u043c\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043f\u043e \u043c\u0435\u0442\u043a\u0435 \u00ab\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435\u00bb<\/u><\/em><\/a><em>. \u0410 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u0435\u043e \u2014 \u043d\u0430 <\/em><a href=\"https:\/\/www.youtube.com\/c\/okiseleva\" rel=\"noopener noreferrer nofollow\"><em><u>\u043c\u043e\u0435\u043c youtube-\u043a\u0430\u043d\u0430\u043b\u0435<\/u><\/em><\/a>\u00a0\u00a0\u00a0<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/816343\/\"> https:\/\/habr.com\/ru\/articles\/816343\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430 \u2014 \u00ab\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c \u0441\u0435\u0431\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0430\u043c. \u041d\u0435 \u043d\u0430\u0434\u0435\u0439\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442\u00bb. \u0422\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435, \u0434\u0430\u0436\u0435 \u043f\u0443\u0441\u0442\u043e\u043c. \u0421\u0430\u043c \u0441\u0435\u0431\u0435 \u0432\u0441\u0451 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b, \u043f\u0440\u043e\u0433\u043d\u0430\u043b \u0442\u0435\u0441\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u0435\u0449\u0451 \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0437\u0430 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412 Postman \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430. \u0423\u0434\u043e\u0431\u043d\u043e \u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0430 \u043e\u043d \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0445\u043e\u0442\u044c \u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u0435, \u0445\u043e\u0442\u044c \u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e pm.sendRequest() \u0432 pre-request \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0443 \u0432 \u0441\u0442\u0438\u043b\u0435 \u00ab\u0431\u0435\u0440\u0438 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0439\u00bb \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 <a href=\"https:\/\/okiseleva.blogspot.com\/2017\/04\/users-soap-rest.html\" rel=\"noopener noreferrer nofollow\"><u>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Users<\/u><\/a>.<\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<ol>\n<li>\n<p><a href=\"#one_req\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 pre-request<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#two_req\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 pre-request<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#itogo\" rel=\"noopener noreferrer nofollow\">\u0418\u0442\u043e\u0433\u043e<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"one_req\" id=\"one_req\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 pre-request<\/h3>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/learning.postman.com\/docs\/tests-and-scripts\/write-scripts\/postman-sandbox-api-reference\/#sending-requests-from-scripts\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a>). \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 postRequest, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e sendRequest:<\/p>\n<pre><code class=\"json\">\/\/ Example with a full-fledged request  const postRequest = { \u00a0\u00a0url: 'https:\/\/postman-echo.com\/post', \u00a0\u00a0method: 'POST', \u00a0\u00a0header: { \u00a0\u00a0\u00a0\u00a0'Content-Type': 'application\/json', \u00a0\u00a0\u00a0\u00a0'X-Foo': 'bar' \u00a0\u00a0}, \u00a0\u00a0body: { \u00a0\u00a0\u00a0\u00a0mode: 'raw', \u00a0\u00a0\u00a0\u00a0raw: JSON.stringify({ key: 'this is json' }) \u00a0\u00a0} };  pm.sendRequest(postRequest, (error, response) => { \u00a0\u00a0console.log(error ? error : response.json()); });<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 Users. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 getUser \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 <em>(\u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 Postman, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u0438\u0434\u0435\u043e \u00ab<\/em><a href=\"https:\/\/youtu.be\/U7-8ZmCBiPI\" rel=\"noopener noreferrer nofollow\"><em><u>\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c REST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442<\/u><\/em><\/a><em>\u00bb \u0438 \u0441\u0442\u0430\u0442\u044c\u044e<\/em> <em>\u00ab<\/em><a href=\"https:\/\/habr.com\/ru\/articles\/554274\/\" rel=\"noopener noreferrer nofollow\"><em>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 JSON<\/em><\/a><em>\u00bb)<\/em>:<\/p>\n<pre><code class=\"json\">\u0422\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 POST URL \u2014 http:\/\/users.bugred.ru\/tasks\/rest\/getuser\u00a0  Body \u0432 json:  {  \u00a0\u00a0\"email\": \"test_habr_1@mail.com\"  }\u00a0<\/code><\/pre>\n<p>\u041d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c. \u0410 \u043f\u043e\u043a\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443: \u00ab\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u00bb<em> (\u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0439\u0442\u0438 \u0448\u0430\u0433\u0438 \u0441 \u043d\u0443\u043b\u044f, \u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 email, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043a\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0435\u0442\u0443)<\/em>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.\u00a0<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c \u2014\u00a0\u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 doregister. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u043d\u0435 pre-request, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"json\">\u0422\u0438\u043f \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 POST URL \u2014 http:\/\/users.bugred.ru\/tasks\/rest\/doregister\u00a0  Body \u0432 json:  { \u00a0\u00a0\u00a0\u00a0\"name\": \"\u0425\u0430\u0431\u0440 1\", \u00a0\u00a0\u00a0\u00a0\"email\": \"test_habr_1@mail.com\", \u00a0\u00a0\u00a0\u00a0\"password\": \"1\" }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u0432 pre-request:<\/p>\n<pre><code class=\"json\">const postRequest = { \u00a0\u00a0url: 'http:\/\/users.bugred.ru\/tasks\/rest\/doregister', \u00a0\u00a0method: 'POST', \u00a0\u00a0body: { \u00a0\u00a0\u00a0\u00a0mode: 'raw', \u00a0\u00a0\u00a0\u00a0raw: JSON.stringify({\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0email: \"test_habr_1@mail.com\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: \"\u0425\u0430\u0431\u0440 1\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0password: 1 \u00a0\u00a0\u00a0\u00a0}) \u00a0\u00a0} };   pm.sendRequest(postRequest, function (err, res) { \u00a0\u00a0console.log(err ? err : res.json().message); });<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00ab<strong>Scripts \u2192 Pre-request\u00bb<\/strong> \u0438 \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u00abSend\u00bb. \u0418 \u0432\u0443\u0430\u043b\u044f, \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e!<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u043e \u043f\u043e\u0441\u0442\u043e\u0439\u0442\u0435\u2026 \u0410 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044e \u0437\u0430\u043f\u0440\u043e\u0441? \u0418 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 pre-request \u0443\u043f\u0430\u0434\u0435\u0442? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c!<\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u2014\u00a0\u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0410 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441 pre-request? \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0451:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434 doregister, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0443\u043b \u0432 Body \u043e\u0448\u0438\u0431\u043a\u0443 \u00abemail \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442\u00bb, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0448\u0435\u043b \u0432\u044b\u0437\u043e\u0432 getuser. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u0437\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 pre-request\u2026 \u0418\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442?<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>Users \u2014 \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430 <u>\u043b\u044e\u0431\u043e\u0439<\/u> \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0435\u0431\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u043a\u043e\u0434 200. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0434\u0435\u0440\u0433\u0430\u044f doregister \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c URL, \u0443\u0434\u0430\u043b\u0438\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0431\u0443\u043a\u0432\u0443 \u2014 <em>url: &#8216;http:\/\/users.bugred.ru\/tasks\/rest\/doregiste&#8217;<\/em><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 GET (\u0430 \u0442\u0430\u043c \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 POST \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f)<\/p>\n<\/li>\n<li>\n<p>\u2026<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u00ab200 \u041e\u041a\u00bb. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u0441\u0451 \u0436\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 URL \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0435, \u0434\u0440\u0443\u0433\u043e\u0435 API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u0410 \u0442\u0435\u043b\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0442 Users, \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430 \u043d\u0435\u043c \u0438 \u0441\u0432\u0430\u043b\u0438\u0442\u0441\u044f.<\/p>\n<p>\u042f \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0430 URL \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 JIRA \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (<em>postRequest2<\/em>). \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0432 pre-request \u0442\u0430\u043a\u043e\u0439 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430:\u00a0<\/p>\n<pre><code class=\"json\">const postRequest2 = { \u00a0\u00a0url: 'https:\/\/testbase.atlassian.net\/rest\/api\/3\/issue\/TEST-18750', \u00a0\u00a0method: 'POST', \u00a0\u00a0body: { \u00a0\u00a0\u00a0\u00a0mode: 'raw', \u00a0\u00a0\u00a0\u00a0raw: JSON.stringify({ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0email: \"test_habr_1@mail.com\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: \"\u0425\u0430\u0431\u0440 1\", \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0password: 1 \u00a0\u00a0\u00a0\u00a0}) \u00a0\u00a0} };  pm.sendRequest(postRequest2, function (err, res) { \u00a0\u00a0console.log(err ? err : res.json().message); });<\/code><\/pre>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0430\u0433\u0430, \u043e\u0448\u0438\u0431\u043e\u0447\u043a\u0430!<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0443\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Glossary\/Idempotent\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u0434\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u00ab\u0442\u0430\u043a\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0431\u0430\u0437\u0435\u00bb, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0432\u043e \u0432\u0441\u044f\u043a\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u00ab\u0435\u0441\u043b\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c, \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u0439\u2026\u00bb.\u00a0<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c pre-request \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435. \u0418 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0441 \u043d\u0438\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0418 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0436\u0435 \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c!<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"two_req\" id=\"two_req\"><\/a><\/p>\n<h3>\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 pre-request<\/h3>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>getUser<\/em>. \u0423 \u043d\u0435\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u2014 \u0432\u043e\u0442 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043e\u043d\u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u044e\u0437\u0435\u0440\u0435. \u0410 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0432 Users \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>createuser<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0437\u0430 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441. \u041d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435\u0442. \u0418 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <em>doregister<\/em>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0447\u0435\u0440\u0435\u0437 <em>fullupdateuser<\/em>.<\/p>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u043a\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c 2 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434\u0440\u044f\u0434:<\/p>\n<pre><code class=\"json\">pm.sendRequest(req1, done); pm.sendRequest(req2, done);<\/code><\/pre>\n<p>\u041d\u043e \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <em>pm.sendRequests<\/em> \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u043e\u0431\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0436\u0438\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 req1, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c req2. \u0418 \u0442\u043e\u0433\u0434\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f, \u0432\u0435\u0434\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0435\u0449\u0451 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d, \u043a\u043e\u0433\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c?<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 req2 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f req1, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 sendRequest \u043f\u043e req1 (<a href=\"https:\/\/community.postman.com\/t\/can-i-use-pm-sendrequest-to-send-requests-synchronously\/225\/4\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430<\/u><\/a>):<\/p>\n<pre><code class=\"json\">pm.sendRequest(req1, function () { \u00a0\u00a0pm.sendRequest(req2, done); });<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c! \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c pre-request \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"json\">const req_1_create = {   url: 'http:\/\/users.bugred.ru\/tasks\/rest\/doregister',   method: 'POST',   body: {     mode: 'raw',     raw: JSON.stringify({          email: \"test_habr_1@mail.com\",         name: \"\u0425\u0430\u0431\u0440 1\",         password: 1     })   } };  const req_2_update = {   url: 'http:\/\/users.bugred.ru\/tasks\/rest\/fullupdateuser',   method: 'POST',   body: {     mode: 'raw',     raw: JSON.stringify({          email: \"test_habr_1@mail.com\",         name: \"\u0412\u0430\u0441\u0435\u043d\u044c\u043a\u0430\",         birthday: \"01.01.1900\",         gender: \"m\",         date_start: \"11.11.2000\",         hobby: \"\u0412\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0438\u0432\u0430\u043d\u0435\",         name1: \"\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439, \u044f\u0441\u0435\u043d \u043f\u0435\u043d\u044c\",         surname1: \"\u0418\u0432\u0430\u043d\u043e\u0432\",         fathername1: \"\u041f\u0435\u0442\u0440\u043e\u0432\",         cat: \"\u041c\u0430\u0440\u0443\u0441\u044f\",         dog: \"\u0423\u0448\u0430\u0441\u0442\u044b\u0439\",         parrot: \"\u0412\u0430\u0441\u044c\u043a\u0430\",         cavy: \"\u041a\u0442\u043e \u0442\u044b?\",         hamster: \"\u0425\u043e\u043c\u044f\u043a\",         squirrel: \"\u0411\u0435\u043b\u0430\u044f \u0433\u043e\u0440\u044f\u0447\u043a\u0430 \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u0430\",         phone: \"333 33 33\",         adres: \"\u0430\u0434\u0440\u0435\u0441 1\",         inn: \"123456789012\"     })   } };  pm.sendRequest(req_1_create, function () {   pm.sendRequest(req_2_update, function (err, res) {   console.log(err ? err : res.json().message); }) });<\/code><\/pre>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0434\u0430! \u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0438\u043c\u044f \u00ab\u0412\u0430\u0441\u0435\u043d\u044c\u043a\u0430\u00bb, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><a class=\"anchor\" name=\"itogo\" id=\"itogo\"><\/a><\/p>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<p>\u0412 Postman \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0432\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 API. \u041e\u0434\u043d\u0430 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 <em>pm.sendRequest()<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>\u041e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u00ab\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u00bb \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b \u0438 \u043d\u0435 \u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043d\u0435 \u043d\u0430\u0434\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043b\u043e\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443 \u00ab\u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b?\u00bb.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e (\u043f\u0430\u043f\u043a\u0443 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c, \u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u0435\u0451. \u0410 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>pm.sendRequest()<\/em> \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0414\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0432\u044b\u0431\u043e\u0440 \u0437\u0430 \u0432\u0430\u043c\u0438.<\/p>\n<p>\u041d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <em>sendRequest<\/em>, \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u2014\u00a0\u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430! \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"json\">pm.sendRequest(req_1, function () { \u00a0\u00a0pm.sendRequest(req_2, function (err, res) { \u00a0\u00a0console.log(err ? err : res.json().message); }) })<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0451, \u0443\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 =)<\/p>\n<p><em>PS \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438\u0449\u0438\u0442\u0435 <\/em><a href=\"https:\/\/okiseleva.blogspot.com\/search\/label\/%D0%BF%D0%BE%D0%BB%D0%B5%D0%B7%D0%BD%D0%BE%D0%B5\" rel=\"noopener noreferrer nofollow\"><em><u>\u0432 \u043c\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043f\u043e \u043c\u0435\u0442\u043a\u0435 \u00ab\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435\u00bb<\/u><\/em><\/a><em>. \u0410 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u0435\u043e \u2014 \u043d\u0430 <\/em><a href=\"https:\/\/www.youtube.com\/c\/okiseleva\" rel=\"noopener noreferrer nofollow\"><em><u>\u043c\u043e\u0435\u043c youtube-\u043a\u0430\u043d\u0430\u043b\u0435<\/u><\/em><\/a>\u00a0\u00a0\u00a0<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/816343\/\"> https:\/\/habr.com\/ru\/articles\/816343\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-376808","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/376808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=376808"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/376808\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=376808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=376808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=376808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}