http_request request(methods::POST);
request.headers().add(L"Content-Type", L"application/json; charset=utf-8");
request.headers().add(L"X-Requested-With", L"XMLHttpRequest");
request.set_body(body);上面的代码给出了以下输出:
HTTP/1.1 400 Bad Request
Connection: close
Content-Length: 334
Content-Type: text/html; charset=us-ascii
Date: Fri, 10 Mar 2017 23:05:43 GMT
Server: Microsoft-HTTPAPI/2.0你能告诉我我的参数出了什么问题吗?
发布于 2017-03-11 23:12:56
已发现客户端正在尝试使用其主机名在本地主机上进行连接。当将客户机的配置更改为连接到localhost:8088而不是degenerated:8088时,它可以工作。因此,侦听地址和目标地址之间不匹配。
https://stackoverflow.com/questions/42729254
复制相似问题