{"id":335298,"date":"2022-07-04T15:00:20","date_gmt":"2022-07-04T15:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=335298"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=335298","title":{"rendered":"<span>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 RESTful HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 C++<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/674304\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yu\/bz\/ck\/yubzckm2rlvjmokxkajfae3vxye.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yu\/bz\/ck\/yubzckm2rlvjmokxkajfae3vxye.png\"\/><\/div>\n<p><\/a><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a REST-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/whoshuu\/cpr\">C++ Request<\/a>, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0425\u0443 \u041d\u0433\u0443\u0439\u0435\u043d\u043e\u043c. \u041f\u0440\u0438 \u0435\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043c\u0438\u0441\u0442\u0435\u0440 \u041d\u0433\u0443\u0435\u043d \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 Python Requests, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u043b\u0438 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 Python Requests, C++ Requests \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430.<a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u0442\u0430\u043a \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c CRUD API (Create, Read, Update, Delete) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ASP.NET Web API 2. \u0421\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u0434\u0435\u044e \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432\u0435\u0431-API \u044f \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u044f\u0441\u043d\u044e. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0430\u0441 \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 (\u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 ASP.NET), \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d ASP.NET Web API<\/font><\/h2>\n<p>  \u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0435\u0431-API \u043d\u0430 ASP.NET. \u0417\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/web-api\/overview\/getting-started-with-aspnet-web-api\/tutorial-your-first-web-api\">\u044d\u0442\u043e\u043c\u0443<\/a> \u0438 <a href=\"https:\/\/docs.microsoft.com\/en-gb\/aspnet\/core\/tutorials\/first-web-api?view=aspnetcore-2.0\">\u044d\u0442\u043e\u043c\u0443<\/a> \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430\u043c \u043e\u0442 Microsoft.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u0435\u0431-API \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u043e \u0441\u0445\u0435\u043c\u0435 \u041cVC (\u043c\u043e\u0434\u0435\u043b\u044c-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440). \u041c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439.<\/p>\n<p>  \u0421\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0447\u0438\u0441\u0442\u044b\u0439 \u0432\u0435\u0431-API \u0441\u0435\u0440\u0432\u0435\u0440 ASP.NET \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u043b\u043e\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>Product<\/code>.<\/p>\n<pre><code class=\"cpp\">public class Product {     public int Id { get; set; }     public string Name { get; set; }     public int Qty { get; set; }     public decimal Price { get; set; } }<\/code><\/pre>\n<p>  \u0412 <code>ProductsController<\/code> \u043a\u043b\u0430\u0441\u0441 <code>Product<\/code> \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u043c <code>static Dictionary<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 API \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0411\u0414.<\/p>\n<pre><code class=\"cpp\">public class ProductsController : ApiController {     static Dictionary&lt;long, Product> products = new Dictionary&lt;long, Product>()<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0451\u0442 \u043c\u0435\u0442\u043e\u0434 <code>Create<\/code>, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>Product<\/code> \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 <code>[FromBody]<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>Product<\/code> \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0438\u0437 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<pre><code class=\"cpp\">[HttpPost] public IHttpActionResult Create([FromBody] Product item) {     if (item == null)     {         return BadRequest();     }      products[item.Id] = item;      return Ok(); }<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u0434\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>curl<\/code>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Postman, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u042f \u0436\u0435 \u0441\u0442\u0430\u0440\u043e\u043c\u043e\u0434\u043d\u044b\u0439 \u043f\u0430\u0440\u0435\u043d\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e <code>curl<\/code>.<\/p>\n<pre><code class=\"bash\">curl -XPOST http:\/\/localhost:51654\/api\/products\/create -H 'Content-Type: application\/json' -d'{\"Id\":1, \"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90}'<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><code>-X<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 HTTP-\u0433\u043b\u0430\u0433\u043e\u043b <code>POST<\/code>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u0443 <code>create<\/code> \u0438\u043b\u0438 <code>update<\/code>;<\/li>\n<li>\u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0438\u0434\u0451\u0442 URL, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441;<\/li>\n<li><code>-H<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438. \u041c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 JSON, \u0437\u043d\u0430\u0447\u0438\u0442, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>'Content-Type'<\/code> \u043d\u0430 <code>'application\/json'<\/code>;<\/li>\n<li><code>-d<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0417\u0434\u0435\u0441\u044c \u044f\u0441\u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044f JSON \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0447\u043b\u0435\u043d\u0430\u043c <code>Product<\/code>.<\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 <code>POST<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 <code>curl<\/code> \u0432\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0441\u0442. \u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 <code>Product<\/code>, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0436\u0435.<\/p>\n<blockquote><p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f HTTP-\u0433\u043b\u0430\u0433\u043e\u043b <code>GET<\/code>.<\/p><\/blockquote>\n<p>  <\/p>\n<pre><code class=\"cpp\"> [HttpGet] public List&lt;Product> GetAll() {     List&lt;Product> temp = new List&lt;Product>();     foreach(var item in products)     {         temp.Add(item.Value);     }     return temp; }  [HttpGet] public IHttpActionResult GetProduct(long id) {     try     {         return Ok(products[id]);     }     catch (System.Collections.Generic.KeyNotFoundException)     {         return NotFound();     } }<\/code><\/pre>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>curl<\/code> \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442 \u0432\u0441\u0435 \u043b\u0438\u0431\u043e \u043e\u0434\u0438\u043d <code>Product<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e <code>id<\/code> (\u0440\u0430\u0432\u0435\u043d <code>1<\/code>). \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u0445 \u044f \u043f\u0440\u043e\u043f\u0443\u0449\u0443.<\/p>\n<pre><code class=\"bash\">curl -XGET http:\/\/localhost:51654\/api\/products'  curl -XGET http:\/\/localhost:51654\/api\/products\/1'<\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"bash\"> [{\"Id\":1,\"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90}]  {\"Id\":1,\"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90}<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0451\u043d \u0432 <code>[]<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <code>Product<\/code>, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0430 \u0432 \u043d\u0435\u0439 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0442\u043e\u0432\u0430\u0440.<\/p>\n<p>  \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <code>Update<\/code> \u0438 <code>Delete<\/code>. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 HTTP-\u0433\u043b\u0430\u0433\u043e\u043b\u0430\u043c\u0438 <code>POST<\/code> \u0438 <code>PUT<\/code> \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>PUT<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0430 <code>POST<\/code> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0433\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cpp\"> [HttpPut] public IHttpActionResult Update(long id, [FromBody] Product item) {     if (item == null || item.Id != id)     {         return BadRequest();     }      if(products.ContainsKey(id)==false)     {         return NotFound();     }     var product = products[id];      product.Name = item.Name;     product.Qty = item.Qty;     product.Price = item.Price;      return Ok(); } [HttpDelete] public IHttpActionResult Delete(long id) {     var product = products[id];     if (product == null)     {         return NotFound();     }      products.Remove(id);      return Ok(); }<\/code><\/pre>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>curl<\/code> \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442 \u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442 <code>Product<\/code> \u0441 <code>id=1<\/code>.<\/p>\n<pre><code class=\"bash\">curl -XPUT http:\/\/localhost:51654\/api\/products\/1 -H 'Content-Type: application\/json' -d'{\"Id\":1, \"Name\":\"ElectricFan\",\"Qty\":15,\"Price\":29.80}'  curl -XDELETE http:\/\/localhost:51654\/api\/products\/1<\/code><\/pre>\n<p>  \u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e <code>Product<\/code> \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0451\u043d, \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>curl<\/code> \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u041a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 C++<\/font><\/h2>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0443\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438! \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c C++ Request, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/whoshuu\/cpr\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a> \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <code>cpr<\/code>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Visual C++ \u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c C++ Request \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/github.com\/Microsoft\/vcpkg\"><i>vcpkg<\/i><\/a>. \u0412 <i>vcpkg<\/i> \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439 <code>cpr<\/code>.<\/p>\n<pre><code class=\"bash\">.\\vcpkg install cpr<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;cpr\/cpr.h><\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <code>POST<\/code> \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 <code>Product<\/code> \u043c\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0433\u043e \u0432 <code>cpr::Body<\/code> \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b, \u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 JSON \u0432\u0441\u0435 \u0434\u0432\u043e\u0439\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438.<\/p>\n<pre><code class=\"cpp\">auto r = cpr::Post(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\/create\" },     cpr::Body{ R\"({\"Id\":1, \"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90})\" },     cpr::Header{ { \"Content-Type\", \"application\/json\" } });<\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u044d\u0442\u043e\u0442 C++ \u043a\u043e\u0434 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>curl<\/code>, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a\u0430\u044f \u0438 \u043a\u0443\u0434\u0430 \u0438\u0434\u0451\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f.<\/p>\n<pre><code class=\"bash\">curl -XPOST http:\/\/localhost:51654\/api\/products\/create -H 'Content-Type: application\/json' -d'{\"Id\":1, \"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90}'<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u0432\u0430\u0440\u0430 \u043c\u044b \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c:<\/p>\n<pre><code class=\"cpp\">auto r = cpr::Get(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\/1\" });<\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>curl<\/code>, \u0447\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 C++ Request \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>libcurl<\/code>.<\/p>\n<pre><code class=\"javascript\">{\"Id\":1,\"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90}<\/code><\/pre>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 C++ \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f CRUD \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u0431-API \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0438\u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 c \u0432\u044b\u0432\u043e\u0434\u043e\u043c. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-API.<\/p>\n<pre><code class=\"cpp\">int main() {     {         std::cout &lt;&lt; \"Action: Create Product with Id = 1\" &lt;&lt; std::endl;         auto r = cpr::Post(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\/create\" },             cpr::Body{ R\"({\"Id\":1,             \"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90})\" },             cpr::Header{ { \"Content-Type\", \"application\/json\" } });         std::cout &lt;&lt; \"Returned Status:\" &lt;&lt; r.status_code &lt;&lt; std::endl;     }     {         std::cout &lt;&lt; \"Action: Retrieve the product with id = 1\" &lt;&lt; std::endl;         auto r = cpr::Get(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\/1\" });         std::cout &lt;&lt; \"Returned Text:\" &lt;&lt; r.text &lt;&lt; std::endl;     }     {         std::cout &lt;&lt; \"Action: Update Product with Id = 1\" &lt;&lt; std::endl;         auto r = cpr::Post(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\/1\" },             cpr::Body{ R\"({\"Id\":1,             \"Name\":\"ElectricFan\",\"Qty\":15,\"Price\":29.80})\" },             cpr::Header{ { \"Content-Type\", \"application\/json\" } });         std::cout &lt;&lt; \"Returned Status:\" &lt;&lt; r.status_code &lt;&lt; std::endl;     }     {         std::cout &lt;&lt; \"Action: Retrieve all products\" &lt;&lt; std::endl;         auto r = cpr::Get(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\" });         std::cout &lt;&lt; \"Returned Text:\" &lt;&lt; r.text &lt;&lt; std::endl;     }     {         std::cout &lt;&lt; \"Action: Delete the product with id = 1\" &lt;&lt; std::endl;         auto r = cpr::Delete(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\/1\" });         std::cout &lt;&lt; \"Returned Status:\" &lt;&lt; r.status_code &lt;&lt; std::endl;     }     {         std::cout &lt;&lt; \"Action: Retrieve all products\" &lt;&lt; std::endl;         auto r = cpr::Get(cpr::Url{ \"http:\/\/localhost:51654\/api\/products\" });         std::cout &lt;&lt; \"Returned Text:\" &lt;&lt; r.text &lt;&lt; std::endl;     }      return 0; }<\/code><\/pre>\n<p>  \u041d\u0438\u0436\u0435, \u043a\u0430\u043a \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432\u044b\u0432\u043e\u0434. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f CRUD \u0435\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0443\u0441. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <i>Create\/Update\/Delete<\/i> \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0442\u0435\u043a\u0441\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0441\u0442\u0430\u0442\u0443\u0441. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u043e\u0434 200, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0443\u0441\u043f\u0435\u0445 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<pre><code class=\"bash\">Action: Create Product with Id = 1 Returned Status:200  Action: Retrieve the product with id = 1 Returned Text:{\"Id\":1,\"Name\":\"ElectricFan\",\"Qty\":14,\"Price\":20.90}  Action: Update Product with Id = 1 Returned Status:200  Action: Retrieve all products Returned Text:[{\"Id\":1,\"Name\":\"ElectricFan\",\"Qty\":15,\"Price\":29.80}]  Action: Delete the product with id = 1 Returned Status:200  Action: Retrieve all products Returned Text:[]<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435, \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>cpr::Parameters<\/code>.<\/p>\n<pre><code class=\"bash\">http:\/\/www.example.com\/products?quota=500&amp;sold=true<\/code><\/pre>\n<p>  \u041a\u043e\u0434 C++ \u0434\u043b\u044f \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 URL:<\/p>\n<pre><code class=\"cpp\">auto r = cpr::Get(cpr::Url{ \"http:\/\/www.example.com\/products\" },     cpr::Parameters{{\"quota\", \"500\"}, {\"sold\", \"true\"}});<\/code><\/pre>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d <a href=\"https:\/\/github.com\/shaovoon\/cpprestexample\">\u043d\u0430 GitHub<\/a> \u0438 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 <a href=\"https:\/\/www.codeproject.com\/KB\/Articles\/1244632\/cpprestexample-1.0.1.zip\">cpprestexample-1.0.1.zip<\/a>.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0418\u0441\u0442\u043e\u0440\u0438\u044f<\/font><\/h2>\n<p>  <\/p>\n<ul>\n<li>28 \u0438\u044e\u043d\u044f, 2022: \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c Newtonsoft.Json \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 RestWebApp.<\/li>\n<li>17 \u043c\u0430\u044f, 2018: \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437.<\/li>\n<\/ul>\n<p>  <a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=Bright_Translate&amp;utm_content=sozdanie_restful_httpzaprosov_na_c++\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ou\/g5\/kh\/oug5kh6sjydt9llengsiebnp40w.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ou\/g5\/kh\/oug5kh6sjydt9llengsiebnp40w.png\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/company\/ruvds\/blog\/674304\/\"> https:\/\/habr.com\/ru\/company\/ruvds\/blog\/674304\/<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/674304\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yu\/bz\/ck\/yubzckm2rlvjmokxkajfae3vxye.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yu\/bz\/ck\/yubzckm2rlvjmokxkajfae3vxye.png\"\/><\/div>\n<p><\/a><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a REST-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/whoshuu\/cpr\">C++ Request<\/a>, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0425\u0443 \u041d\u0433\u0443\u0439\u0435\u043d\u043e\u043c. \u041f\u0440\u0438 \u0435\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043c\u0438\u0441\u0442\u0435\u0440 \u041d\u0433\u0443\u0435\u043d \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 Python Requests, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u043b\u0438 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 Python Requests, C++ Requests \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430.<\/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-335298","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335298","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=335298"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335298\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}