zanllp / sion Goto Github PK
View Code? Open in Web Editor NEWA single-header, cross-platform C++ library for making asynchronous HTTP(s) Requests.
License: MIT License
A single-header, cross-platform C++ library for making asynchronous HTTP(s) Requests.
License: MIT License
‘WSADATA’ was not declared in this scope
如题,请问可以添加对应的LISENCE吗? 十分感谢!
请教下,如何才能实现chunk模式的post请求呢?
异步请求的例子没有了,是没有写吗?
输出诸如“未定义的标识符”“语法错误”“跳过明显的函数体”等。环境:MSVC 19.30.30401
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
报错错误如下:
/tmp/ccaD5zPb.s: Assembler messages:
/tmp/ccaD5zPb.s:7824: Error: symbol `_ZNK4sionUlvE_clEv' is already defined
...
demo代码如下:
`
#include
#define SION_DISABLE_SSL
#include "sion/sion.h"
static int req_id = 0;
static sion::Async async_thread_pool;
int main() {
std::string url;
std::string body;
int timeoutMs;
std::string content_type;
int req;
async_thread_pool.Run(
[body, url, content_type] {
return sion::Request()
.SetUrl(url)
.SetHttpMethod(sion::Method::Post)
.SetBody(body)
.SetHeader("Content-Type", content_type);
},
[req](sion::AsyncResponse async_resp) {
// qDebug() << req << async_resp.err_msg.c_str();
});
return 0;
}
我定义了unicode编码
sion.hpp(667,1): error C2664: “INT InetPtonW(INT,PCWSTR,PVOID)”: 无法将参数 2 从“const _Elem *”转换为“PCWSTR”
`
...
auto target_ip =
enable_proxy_
? (proxy_.host.HasLetter() ? GetIpByHost(proxy_.host) : proxy_.host)
: ip_;
#ifdef _WIN32
checkstd::invalid_argument(
(InetPton(AF_INET, target_ip.c_str(), &sa) != -1), "地址转换错误");//报错,详情如上
#else
checkstd::invalid_argument(
(inet_pton(AF_INET, target_ip.c_str(), &sa) != -1), "地址转换错误");
#endif
...
`
错误 C2664
“std::basic_string<char,std::char_traits,std::allocator>::basic_string(const std::basic_string<char,std::char_traits,std::allocator> &)”: 无法将参数 1 从“_Ty”转换为“std::initializer_list<_Elem>”
WeChatHelper c:\users\sion.h 19
代码:
auto resp = sion::Request()
.SetUrl("http://httpbin.org/get")
.SetHttpMethod(sion::Method::Post)
.SetBody(R"({"data": 233333,"msg":"hello world!"})")
.SetHeader("Content-Type", "application/json; charset=utf-8")
.Send();
std::cout << resp.StrBody() << std::endl;
std::cout << "done \n";
结果:
描述:
使用sion发送Post请求,charles 抓包,发现请求地址有问题。没有请求成功
ubuntu下gcc编译会报错
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.