char *pHttpPost = "POST %s HTTP/1.1\r\n"
"Host: %s:%d\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Length: %d\r\n\r\n"
"%s";

char strHttpPost[1024] = { 0 };

sprintf(strHttpPost, pHttpPost, weburl.c_str(), ip.c_str(), port, data.length(), data.c_str());

//连接socket代码省略

// 发送
errCode = send(clientSocket, strHttpPost, strlen(strHttpPost), 0);

相关文章:

  • 2021-09-27
  • 2023-03-07
  • 2021-08-17
  • 2021-12-14
  • 2021-12-21
  • 2021-10-30
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-10-05
  • 2021-12-31
  • 2021-11-16
相关资源
相似解决方案