In Java, the socket must distinguish between print () and println () when sending a request.

Source: Internet
Author: User

Recently in the development needs a function, to the third-party server to send our data, the package format requirements of the data is particularly strict, after the completion of the assembly data, sent to the third party server but how can not pass, looked for a long time, also compared to the other side of the data samples, or not, Later check the code and intercept the sent data only found that when the socket is sent, using the println () method, this method will automatically add a carriage return after the data, so in comparison with the data is not found, changed to print () after the smooth passage ~ ~ ~

In Java, the socket must distinguish between print () and println () when sending a request.

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.