Hi This is my document
in php $xmldoc = '<add><doc><field name="id">F_146</field><field name="userid">74</field><field name="groupuseid">gmail.com</field><field name="attachment_size">121</field><field name="attachment_name">sample.pptx</field></doc></add>'; $ch = curl_init("http://localhost:8080/solr/update"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml") ); curl_setopt($ch, CURLOPT_POSTFIELDS,$xmldoc); $result= curl_exec($ch); if(!curl_errno($ch)) { $info = curl_getinfo($ch); $header = substr($response, 0, $info['header_size']); echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url']; }else{ print_r('no idea'); } println('result of query'.' '.' -> '.$result); It is throwing error <html><head><title>Apache Tomcat/6.0.18 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - Unexpected character ''' (code 39) in prolog; expected '<' at [row,col {unknown-source}]: [1,1]</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Unexpected character ''' (code 39) in prolog; expected '<' at [row,col {unknown-source}]: [1,1]</u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect (Unexpected character ''' (code 39) in prolog; expected '<' at [row,col {unknown-source}]: [1,1]).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html> Thanks Naveen