Problems encountered while working. The browser can view the JSON data, but the other person will not receive the data.
Finally found Contentlength=-1 found.
Find the question: why. NET program Download the Contentlength=-1?
Excerpt as follows: With the HTTP analysis tool will find that the reason is very simple, this is because some Web servers in the delivery of response content, the compression algorithm such as gzip or deflate compression of the content of the Web page, so that the content of the Web page packet size greatly reduced, thereby speeding up the network transmission, This way, the client's browser display page also accelerates. This is because of this gzip or deflate feature, so that the Web page data in the HTTP transmission will not add the ContentLength attribute in the header, so the program will retrieve the value of ContentLength by default is-1 (without gzip or Deflate feature pages will certainly contentlength specific values).
Workaround:header(' content-length: '. strlen ($json));
Just send the header before outputting the JSON data.
Of course you can also turn off the server gzip feature, not recommended.
The PHP Interface (C #) does not receive data? Contentlength=-1