Advertisement
oquidave

xml post

Jul 22nd, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. $ch = curl_init();
  2. curl_setopt($ch, CURLOPT_HEADER, 1);
  3. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  4. //$url = 'http://localhost:10088/travelport_dev/smsxml.php';
  5. $url = "http://lambda.smsmedia.ug/travelport/index.php";
  6. curl_setopt($ch, CURLOPT_URL, $url);
  7. curl_setopt($ch, CURLOPT_POST, 1);
  8. curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
  9. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  10. $content=curl_exec($ch);
  11. $info = curl_getinfo($ch);
  12. $htt_code = $info['http_code'];
  13. curl_close($ch);
  14.  
  15. $content var_dump
  16.  
  17.  
  18. (string:1661) HTTP/1.0 417 Expectation failed
  19. Server: squid/2.7.STABLE6
  20. Date: Fri, 22 Jul 2011 08:19:59 GMT
  21. Content-Type: text/html
  22. Content-Length: 1318
  23. X-Squid-Error: ERR_INVALID_REQ 0
  24. X-Cache: MISS from mail.smsmedia.info
  25. X-Cache-Lookup: NONE from mail.smsmedia.info:3128
  26. Via: 1.0 mail.smsmedia.info:3128 (squid/2.7.STABLE6)
  27. Connection: close
  28.  
  29. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  30. <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  31. <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
  32. <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
  33. </HEAD><BODY>
  34. <H1>ERROR</H1>
  35. <H2>The requested URL could not be retrieved</H2>
  36. <HR noshade size="1px">
  37. <P>
  38. While trying to process the request:
  39. <PRE>
  40. POST /travelport/index.php HTTP/1.1
  41. Host: lambda.smsmedia.ug
  42. Accept: */*
  43. Content-Type: text/xml
  44. Content-Length: 1281
  45. Expect: 100-continue
  46.  
  47. </PRE>
  48. <P>
  49. The following error was encountered:
  50. <UL>
  51. <LI>
  52. <STRONG>
  53. Invalid Request
  54. </STRONG>
  55. </UL>
  56.  
  57. <P>
  58. Some aspect of the HTTP Request is invalid. Possible problems:
  59. <UL>
  60. <LI>Missing or unknown request method
  61. <LI>Missing URL
  62. <LI>Missing HTTP Identifier (HTTP/1.0)
  63. <LI>Request is too large
  64. <LI>Content-Length missing for POST or PUT requests
  65. <LI>Illegal character in hostname; underscores are not allowed
  66. </UL>
  67. <P>Your cache administrator is <A HREF="mailto:webmaster">webmaster</A>.
  68.  
  69. <BR clear="all">
  70. <HR noshade size="1px">
  71. <ADDRESS>
  72. Generated Fri, 22 Jul 2011 08:19:59 GMT by mail.smsmedia.info (squid/2.7.STABLE6)
  73. </ADDRESS>
  74. </BODY></HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement