In general, the point is not that I can not send CURLOL POST data, but the trap is that the data needs to be transmitted not in pairs ie. POST over HTTPS to send XML data.

but the server simply accepts XML without a parameter, i.e. not? data = "<XML>" but just XML as a stream.

In the head just does not climb.

Can try with sockets?

Or who did that. I only submit a referral, and then the work has come down, you know (who works)

up

2 answers 2

sending stream by socket:

<? $data = 'xml'; if ($s = @fsockopen(gethostbyname('somesite.com'), 443 /* https */, $errno, $errstr, 3 /* timeout*/)) { /* begin Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ нСнуТная Ρ‡Π°ΡΡ‚ΡŒ, исходя ΠΈΠ· "ΠΏΡ€ΠΈΠ½ΠΈΠΌΠ°Π΅Ρ‚ ΠΏΠΎΡ‚ΠΎΠΊ" */ fwrite($s, "POST /URI/ HTTP/1.1\r\n". "Host: somesite.com\r\n". "Content-Type: text/xml; charset=utf-8\r\n". "Content-Length: ".strlen($data)."\r\n". "\r\n" ); /* end */ fwrite($s, $data); $response = ''; do { $part = fread($s, 4096); $response .= $part; } while (strlen($part) == 4096); fclose($s); } else die('Can\'t connect'); echo $response; ?> 
  • Oh yeah, if you have mb_func_overload == 'On' - communicate yourself with the definition of the length of the string)) For fread / fwrite read bytes and return the number of bytes. - Sh4dow

In general, rolled bonal curl oddly enough.

The only thing that. On LAN did not send a request, on a dedicated server went.

phpinfo showed the same settings.

In general, the problem is solved. Thank you all and Respectos! Shadow +1