网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

微信小程序lianc++后臺

發布時間:2018-02-01 18:29 所屬欄目:小程序開發教程

貼上微信小程序發送http請求代碼:

 

[javascript] view plain copy
 
  1. onsend: function(){      
  2.    wx.request({  
  3.       url: 'http://127.0.0.1:1000', //c++后臺ip、端口  
  4.       data: {  
  5.           x: '1' , //發送到后臺字段  
  6.           y: '2'  
  7.  },  
  8.  header:{  
  9.      "Content-Type":"application/json"  
  10.  },  
  11.  method:"POST", //發送POST,若為GET則改為GET  
[javascript] view plain copy
 
  1. success: function(res) {  
  2.    var data = res.data;  
  3.    console.log(data);  
  4. }  
  5. });  
  6. }  

c++后臺代碼借鑒boost官網的asio的http server 3地址并自己做了修改:

 

官網地址:http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/examples.html

修改代碼:

1、request_parser.hpp:

 

[cpp] view plain copy
 
  1. //  
  2. // request_parser.hpp  
  3. // ~~~~~~~~~~~~~~~~~~  
  4. //  
  5. // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)  
  6. //  
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying  
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)  
  9. //  
  10.   
  11. #ifndef HTTP_SERVER3_REQUEST_PARSER_HPP  
  12. #define HTTP_SERVER3_REQUEST_PARSER_HPP  
  13.   
  14. #include <boost/logic/tribool.hpp>  
  15. #include <boost/tuple/tuple.hpp>  
  16.   
  17. namespace http {  
  18. namespace server3 {  
  19.   
  20. struct request;  
  21.   
  22. /// Parser for incoming requests.  
  23. class request_parser  
  24. {  
  25. public:  
  26.   /// Construct ready to parse the request method.  
  27.   request_parser();  
  28.   
  29.   /// Reset to initial parser state.  
  30.   void reset();  
  31.   
  32.   /// Parse some data. The tribool r


易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/21402.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×