欢迎来到258分享网,纯净的网络源码分享基地!

258资源分享网

全部作品
全部作品
网站源码
微信源码
素材特效
源码插件
视频教程
建站学院
热门搜索: 织梦  农业种植  农业  安全设置  官方
258资源分享 > 建站学院 > 微信开发 > 微信小程序lianc++后台

推荐下载

HTML5响应式自适应网咯设计

2020-05-12   浏览:740

高端HTML5响应式企业通用网

2020-05-06   浏览:521

html5响应式外贸网站英文版

2020-05-08   浏览:510

HTML5自适应律师工作室类网

2020-04-04   浏览:504

HTML5影视传媒文化公司类网

2020-05-12   浏览:502

微信小程序lianc++后台

发布时间:2020-12-23  

贴上微信小程序发送http请求代码:

[javascript] view plain copy

 

onsend: function(){      

   wx.request({  

      url: ':1000', //c++后台ip、端口  

      data: {  

          x: '1' , //发送到后台字段  

          y: '2'  

 },  

 header:{  

     "Content-Type":"application/json"  

 },  

 method:"POST", //发送POST,若为GET则改为GET  

[javascript] view plain copy

 

success: function(res) {  

   var data = res.data;  

   console.log(data);  

}  

});  

}  


c++后台代码借鉴boost官网的asio的http server 3地址并自己做了修改:

官网地址:

修改代码:

1、request_parser.hpp:

[cpp] view plain copy

 

//  

// request_parser.hpp  

// ~~~~~~~~~~~~~~~~~~  

//  

// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)  

//  

// Distributed under the Boost Software License, Version 1.0. (See accompanying  

// file LICENSE_1_0.txt or copy at )  

//  

  

#ifndef HTTP_SERVER3_REQUEST_PARSER_HPP  

#define HTTP_SERVER3_REQUEST_PARSER_HPP  

  

#include <boost/logic/tribool.hpp>  

#include <boost/tuple/tuple.hpp>  

  

namespace http {  

namespace server3 {  

  

struct request;  

  

/// Parser for incoming requests.  

class request_parser  

{  

public:  

  /// Construct ready to parse the request method.  

  request_parser();  

  

  /// Reset to initial parser state.  

  void reset();  

  

  /// Parse some data. The tribool r

本文标签

: