Problems with implementing HTTP/HTTPS post in C/C ++

Source: Internet
Author: User

It is really unpleasant to use Microsoft's set of things. Writing a Small HTTP/HTTPS post function is all crazy.

Connection, send, and close.

The API httpsendrequest is used for sending, but the body of this method (that is, the 4th parameters must be multi-Char), so you are currently using Unicode, it must be converted to multi-Char.

What are the consequences of not converting? The result is that the post data is incomplete. In addition, post data only has one letter.

Unfortunately, msdn does not explain this API clearly. This will make people do not know the reason.

Continue to think about the fact that MFC actually encapsulates the underlying API. Does the sendrequest of chttpfile have a similar problem? The answer is yes. The solution is described above.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.