{"id":289522,"date":"2018-09-17T21:15:02","date_gmt":"2018-09-17T17:15:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=289522"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=289522","title":{"rendered":"\u0421\u0442\u0430\u0440\u044b\u0435 \u043f\u0435\u0441\u043d\u0438 \u043e \u0433\u043b\u0430\u0432\u043d\u043e\u043c. Java \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gc\/zo\/yn\/gczoyneiff_giu5osapzaaekbpw.png\"><\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f 99.9% \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u043c. \u042d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0435 API, \u0442\u0430\u043a \u0438 \u00ab\u0441\u0432\u043e\u0438\u00bb \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0435 \u0438 \u0432\u0441\u0451 \u0431\u044c\u044e\u0442 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u2014 \u0434\u0430. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u044e\u0442 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b. \u041c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c 5 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 Java (c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0431\u0435\u0437)? \u041d\u0435\u0442 \u2014 \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442, \u0434\u0430 \u2014 \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \ud83d\ude09 <a name=\"habracut\"><\/a><br \/>  \u2026<\/p>\n<h1>0. Intro<\/h1>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c, \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430: \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c GET\/POST \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441, \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c (https:\/\/jsonplaceholder.typicode.com\/), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u044b, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0445\u0438\u0442\u0440\u043e\u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 \u0441 auth \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438 \u0442\u0443\u0442 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0422\u043e\u043b\u044c\u043a\u043e POST \u0438 GET, GET \u0438 POST, \u0438 \u0442\u0430\u043a 5 \u0440\u0430\u0437 \u0438\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0442\u043e\u0433\u043e.<br \/>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438.<\/p>\n<h1>1. Built-in Java solution<\/h1>\n<p>  \u0411\u044b\u043b\u043e \u0431\u044b \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e! (\u043d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u043e) \u041f\u0430\u043a\u0435\u0442 java.net, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <br \/>  HttpURLConnection, URL \u0438 URLEnconder<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e GET, \u0447\u0442\u043e POST \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 URL \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"java\">final URL url = new URL(\"http:\/\/jsonplaceholder.typicode.com\/posts?_limit=10\");         final HttpURLConnection con = (HttpURLConnection) url.openConnection();<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u043e\u0431\u0440\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"java\">con.setRequestMethod(\"GET\");         con.setRequestProperty(\"Content-Type\", \"application\/json\");         con.setConnectTimeout(CONNECTION_TIMEOUT);         con.setReadTimeout(CONNECTION_TIMEOUT);<\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c InputStream \u043e\u0442\u043a\u0443\u0434\u0430 \u0443\u0436\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<pre><code class=\"java\">   try (final BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()))) {             String inputLine;             final StringBuilder content = new StringBuilder();             while ((inputLine = in.readLine()) != null) {                 content.append(inputLine);             }             return content.toString();         } catch (final Exception ex) {             ex.printStackTrace();             return \"\";         }<\/code><\/pre>\n<p>  \u0418 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c (\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0431\u043e \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043e\u0434\u043d\u0438\u043c\u0438 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438):<\/p>\n<pre><code class=\"java\">[   {     \"userId\": 1,     \"id\": 1,     \"title\": \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\",     \"body\": \"quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto\"   },   {     \"userId\": 1,     \"id\": 2,     \"title\": \"qui est esse\",     \"body\": \"est rerum tempore vitae\\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\\nqui aperiam non debitis possimus qui neque nisi nulla\"   }, ... {     \"userId\": 1,     \"id\": 9,     \"title\": \"nesciunt iure omnis dolorem tempora et accusantium\",     \"body\": \"consectetur animi nesciunt iure dolore\\nenim quia ad\\nveniam autem ut quam aut nobis\\net est aut quod aut provident voluptas autem voluptas\"   },   {     \"userId\": 1,     \"id\": 10,     \"title\": \"optio molestias id quia eum\",     \"body\": \"quo et expedita modi cum officia vel magni\\ndoloribus qui repudiandae\\nvero nisi sit\\nquos veniam quod sed accusamus veritatis error\"   } ]<\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 POST \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0432\u043d\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041c\u044b \u0436\u0435 \u0445\u043e\u0442\u0438\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">final Map&lt;String, String&gt; parameters = new HashMap&lt;&gt;();         parameters.put(\"title\", \"foo\");         parameters.put(\"body\", \"bar\");         parameters.put(\"userId\", \"1\");          con.setDoOutput(true);         final DataOutputStream out = new DataOutputStream(con.getOutputStream());         out.writeBytes(getParamsString(parameters));         out.flush();         out.close(); <\/code><\/pre>\n<p>  \u0413\u0434\u0435 getParamsString \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0435\u0440\u0435\u0433\u043e\u043d\u044f\u044e\u0449\u0438\u0439 Map \u0432 String \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043f\u0430\u0440\u044b \u043a\u043b\u044e\u0447 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"java\">public static String getParamsString(final Map&lt;String, String&gt; params) {         final StringBuilder result = new StringBuilder();          params.forEach((name, value) -&gt; {             try {                 result.append(URLEncoder.encode(name, \"UTF-8\"));                 result.append('=');                 result.append(URLEncoder.encode(value, \"UTF-8\"));                 result.append('&amp;');             } catch (final UnsupportedEncodingException e) {                 e.printStackTrace();             }         });          final String resultString = result.toString();         return !resultString.isEmpty()                 ? resultString.substring(0, resultString.length() - 1)                 : resultString;     }<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e:<\/p>\n<pre><code class=\"java\">{  \"title\": \"foo\",  \"body\": \"bar\",  \"userId\": \"1\",  \"id\": 101}<\/code><\/pre>\n<p>  <a href=\"http:\/\/github.com\/umbrellaitcom\/java-api-caller\/blob\/master\/src\/main\/java\/com\/umbrellait\/builtin\/Runner.java\">\u0421\u0441\u044b\u043b\u043e\u0447\u043a\u0430<\/a> \u043d\u0430 source \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h1>2. Apache HTTP client<\/h1>\n<p>  \u0415\u0441\u043b\u0438 \u0443\u0439\u0442\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u043d\u0430 \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u0442\u043a\u043d\u0435\u043c\u0441\u044f \u2014 http client \u043e\u0442 Apache. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0430\u043c jar \u0444\u0430\u0439\u043b, \u0438\u043b\u0438 \u0442.\u043a. \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Maven \u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"java\"> &lt;dependency&gt;             &lt;groupId&gt;org.apache.httpcomponents&lt;\/groupId&gt;             &lt;artifactId&gt;httpclient&lt;\/artifactId&gt;             &lt;version&gt;4.5.6&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>  \u0418 \u0442\u043e \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c http client\u2019a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0436\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 (<a href=\"http:\/\/github.com\/umbrellaitcom\/java-api-caller\/blob\/master\/src\/main\/java\/com\/umbrellait\/apacheclient\/Runner.java\">Source<\/a>):<\/p>\n<pre><code class=\"java\"> final CloseableHttpClient httpclient = HttpClients.createDefault();          final HttpUriRequest httpGet = new HttpGet(\"http:\/\/jsonplaceholder.typicode.com\/posts?_limit=10\");         try (                 CloseableHttpResponse response1 = httpclient.execute(httpGet)         ){             final HttpEntity entity1 = response1.getEntity();             System.out.println(EntityUtils.toString(entity1));         }          final HttpPost httpPost = new HttpPost(\"http:\/\/jsonplaceholder.typicode.com\/posts\");         final List&lt;NameValuePair&gt; params = new ArrayList&lt;&gt;();         params.add(new BasicNameValuePair(\"title\", \"foo\"));         params.add(new BasicNameValuePair(\"body\", \"bar\"));         params.add(new BasicNameValuePair(\"userId\", \"1\"));         httpPost.setEntity(new UrlEncodedFormEntity(params));           try (                 CloseableHttpResponse response2 = httpclient.execute(httpPost)         ){             final HttpEntity entity2 = response2.getEntity();             System.out.println(EntityUtils.toString(entity2));         }         httpclient.close();<\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u0435 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0434\u0432\u043e\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0443\u0434\u0430 \u0435\u0449\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435, \u043d\u043e \u0443 apache \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n<h1>3. Apache fluent API<\/h1>\n<p>  <\/p>\n<pre><code class=\"java\">        &lt;dependency&gt;             &lt;groupId&gt;org.apache.httpcomponents&lt;\/groupId&gt;             &lt;artifactId&gt;fluent-hc&lt;\/artifactId&gt;             &lt;version&gt;4.5.6&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>  \u0418 \u0443\u0436\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c fluent api \u043d\u0430\u0448\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u0435\u0435 (<a href=\"http:\/\/github.com\/umbrellaitcom\/java-api-caller\/blob\/master\/src\/main\/java\/com\/umbrellait\/apachefluentapi\/Runner.java\">Source<\/a>):<\/p>\n<pre><code class=\"java\">        final Content getResult = Request.Get(\"http:\/\/jsonplaceholder.typicode.com\/posts?_limit=10\")                 .execute().returnContent();         System.out.println(getResult.asString());          final Collection&lt;NameValuePair&gt; params = new ArrayList&lt;&gt;();         params.add(new BasicNameValuePair(\"title\", \"foo\"));         params.add(new BasicNameValuePair(\"body\", \"bar\"));         params.add(new BasicNameValuePair(\"userId\", \"1\"));          final Content postResultForm = Request.Post(\"http:\/\/jsonplaceholder.typicode.com\/posts\")                 .bodyForm(params, Charset.defaultCharset())                 .execute().returnContent();         System.out.println(postResultForm.asString());<\/code><\/pre>\n<p>  \u0418 \u043a\u0430\u043a \u0431\u043e\u043d\u0443\u0441, \u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u043e\u0434\u0438 \u043d\u0435 \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0443 \u0430 \u043a\u0430\u043a \u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 JSON:<\/p>\n<pre><code class=\"java\">        final Content postResult = Request.Post(\"http:\/\/jsonplaceholder.typicode.com\/posts\")                 .bodyString(\"{\\\"title\\\": \\\"foo\\\",\\\"body\\\":\\\"bar\\\",\\\"userId\\\": 1}\", ContentType.APPLICATION_JSON)                 .execute().returnContent();         System.out.println(postResult.asString());<\/code><\/pre>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438, \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0445\u043b\u043e\u043f\u043d\u0443\u043b\u0438\u0441\u044c \u0432 1 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043a\u043e\u0434\u0430, \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435, \u044d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u043e \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0447\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. <\/p>\n<h1>4. Spring RestTemplate<\/h1>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0434\u0430\u043b\u044c\u0448\u0435? \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u043f\u044b\u0442 \u043c\u0435\u043d\u044f \u0437\u0430\u0432\u0435\u043b \u0432 \u043c\u0438\u0440 Spring. \u0418 \u0447\u0442\u043e \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0443 \u0441\u043f\u0440\u0438\u043d\u0433\u0430 \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 (\u0441\u0442\u0440\u0430\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u0434\u0430? \u0417\u0430\u0434\u0430\u0447\u0430, \u0434\u0430\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c! \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e). \u0418 \u043f\u0435\u0440\u0432\u043e\u0435 \u0436\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 (\u0431\u0430\u0437\u043e\u0432\u043e\u0435), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 Spring \u044d\u0442\u043e RestTemplate. \u0418 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u044f\u043d\u0443\u0442\u044c \u0443\u0436\u0435 \u043d\u0435\u043c\u0430\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0437\u043e\u043e\u043f\u0430\u0440\u043a\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u041d\u0415 \u0441\u043f\u0440\u0438\u043d\u0433\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u043e \u0440\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0442\u044f\u043d\u0443\u0442\u044c \u0432\u0441\u044e \u043a\u0443\u0445\u043d\u044e. \u0410 \u0435\u0441\u043b\u0438 \u0441\u043f\u0440\u0438\u043d\u0433 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u0434\u0430. \u041a\u0430\u043a \u043f\u0440\u0438\u0442\u044f\u043d\u0443\u0442\u044c \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u041d\u0443 \u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e GET \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c RestTemplate \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:   <\/p>\n<pre><code class=\"java\">        final RestTemplate restTemplate = new RestTemplate();          final String stringPosts = restTemplate.getForObject(\"http:\/\/jsonplaceholder.typicode.com\/posts?_limit=10\", String.class);         System.out.println(stringPosts);<\/code><\/pre>\n<p>  \u0413\u0443\u0434. \u041d\u041e! \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0443\u0436\u0435 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c! \u0421\u043e\u0437\u0434\u0430\u0435\u043c, \u043e\u0431\u044a\u0435\u043a\u0442 Post:<\/p>\n<pre><code class=\"java\">import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Builder; import lombok.Getter; import lombok.Setter;  @Builder @Getter @Setter @JsonIgnoreProperties(ignoreUnknown = true) public class Post {      private int id;     private String title;     private String body;     private int userId;      public String toString() {         return String.format(\"\\n id: %s \\n title: %s \\n body: %s \\n userId: %s \\n\", id, title, body, userId);     } }<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c: <br \/>  <b>Builder, Getter, Setter<\/b> \u2014 \u0441\u0430\u0445\u0430\u0440 \u043e\u0442 lombok, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0443\u043a\u0430\u043c\u0438. \u0414\u0430 \u0432\u043e\u0442 \u043e\u043d\u0430 \u043b\u0435\u043d\u044c \u043c\u0430\u0442\u0443\u0448\u043a\u0430. <br \/>  <b>JsonIgnoreProperties<\/b> \u2014 \u0447\u0442\u043e\u0431\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043d\u0435 \u0432\u044b\u043b\u0435\u0442\u0430\u0442\u044c \u0432 \u043e\u0448\u0438\u0431\u043a\u0443, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u043f\u043e\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b.<br \/>  \u041d\u0443 \u0438 <b>toString<\/b>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. \u041d\u0443 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0448\u0438 GET \u0438 POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u043f\u043b\u043e\u0449\u0430\u044e\u0442\u0441\u044f \u0432 (<a href=\"http:\/\/github.com\/umbrellaitcom\/java-api-caller\/blob\/master\/src\/main\/java\/com\/umbrellait\/resttemplate\/Runner.java\">Source<\/a>):<\/p>\n<pre><code class=\"java\">        \/\/ Map it to list of objects         final Post[] posts = restTemplate.getForObject(\"http:\/\/jsonplaceholder.typicode.com\/posts?_limit=10\", Post[].class);         for (final Post post : posts) {             System.out.println(post);         }          final Post postToInsert = Post.builder()                 .body(\"bar\")                 .title(\"foo\")                 .userId(1)                 .build();          final Post insertedPost = restTemplate.postForObject(\"http:\/\/jsonplaceholder.typicode.com\/posts\", postToInsert, Post.class);         System.out.println(insertedPost);<\/code><\/pre>\n<p>  \u0418 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0432 \u0440\u0443\u043a\u0430\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0430 \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. <\/p>\n<p>  \u041a\u0443\u043b. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u0440\u0435\u0441\u0442 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0440\u043e\u0438\u043b\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0432\u0441\u0435 \u0436\u0435 \u0437\u043d\u0430\u044e\u0442 \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e PEBCAK (Problem Exists between Chair and Keyboard)\u2026<\/p>\n<h1>5. Spring Feign<\/h1>\n<p>  \u0418 \u0442\u0443\u0442 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 feign \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u0441\u043f\u0440\u0438\u043d\u0433 \u041a\u043b\u0430\u0443\u0434. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u0430\u043d\u0435\u0435 \u0441\u043f\u0440\u0438\u043d\u0433\u043e\u0432\u043e\u043c\u0443 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044e feign \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"java\"> &lt;dependency&gt;             &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;             &lt;artifactId&gt;spring-cloud-starter-feign&lt;\/artifactId&gt;             &lt;version&gt;1.4.5.RELEASE&lt;\/version&gt;         &lt;\/dependency&gt; <\/code><\/pre>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438 \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0438 \u0441\u0434\u043e\u0431\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0436\u043c\u0435\u043d\u044c\u043a\u043e\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u0435\u043d \u0442\u0435\u043c, \u043a\u0442\u043e \u043f\u0438\u0448\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0440\u0438\u043d\u0433\u0430. <\/p>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c feign (<a href=\"http:\/\/github.com\/umbrellaitcom\/java-api-caller\/tree\/master\/src\/main\/java\/com\/umbrellait\/feign\">Source<\/a>). <\/p>\n<pre><code class=\"java\">@FeignClient(name = \"jsonplaceholder\", url = \"http:\/\/jsonplaceholder.typicode.com\", path = \"\/posts\") public interface ApiClient {      @RequestMapping(method = GET, value = \"\/\", consumes = APPLICATION_JSON_VALUE)     List&lt;Post&gt; getPosts(@RequestParam(\"_limit\") final int postLimit);      @RequestMapping(method = POST, value = \"\/\", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)     Post savePost(@RequestBody Post post); }<\/code><\/pre>\n<p>  \u041a\u0440\u0430\u0441\u043e\u0442\u0430, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438? \u0418 \u0434\u0430, \u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u043b\u044f resttemplate \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c.<\/p>\n<h1>6. Conclusion<\/h1>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043d\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u044f\u0442\u0438. \u0414\u0430\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0430 \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u044b\u0442\u0430 \u0430\u0432\u0442\u043e\u0440\u0430, \u0432 \u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0441 \u043d\u0438\u043c\u0438 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0421\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e feign, \u0440\u0430\u0434\u0443\u044e\u0441\u044c \u0436\u0438\u0437\u043d\u0438 \u0438 \u0436\u0434\u0443 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0435\u0449\u0451 \u0447\u0442\u043e \u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u0440\u0438\u043a\u043d\u0443\u0442\u044c \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 &#171;&lt;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438&gt; \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0442\u0435\u0431\u044f&#187; \u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u043d\u0443 \u0430 \u043f\u043e\u043a\u0430 feign.<\/p>\n<p>  <b>PS<\/b> \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u0438\u0437 \u201c\u043b\u0435\u043d\u0438\u0432\u044b\u0445\u201d \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 swagger \u043a\u043b\u0438\u0435\u043d\u0442, \u043d\u043e, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. \u0414\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 swagger \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0430\u043f\u0438, \u0438 \u0435\u0449\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442, \u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u044d\u043d\u0442\u043e\u043c\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u0434\u0430, \u0447\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u044b.<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/423591\/\"> https:\/\/habr.com\/post\/423591\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gc\/zo\/yn\/gczoyneiff_giu5osapzaaekbpw.png\"><\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f 99.9% \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u0435\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u043c. \u042d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0435 API, \u0442\u0430\u043a \u0438 \u00ab\u0441\u0432\u043e\u0438\u00bb \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0435 \u0438 \u0432\u0441\u0451 \u0431\u044c\u044e\u0442 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u2014 \u0434\u0430. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u044e\u0442 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b. \u041c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c 5 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 Java (c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0431\u0435\u0437)? \u041d\u0435\u0442 \u2014 \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442, \u0434\u0430 \u2014 \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \ud83d\ude09 <\/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-289522","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289522","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=289522"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289522\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}