Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jim Gibson Newsgroups: comp.lang.java.programmer Subject: Re: CURL-PHP to Java-HTTPComponents Date: Thu, 25 Oct 2012 17:16:39 -0700 Lines: 24 Message-ID: <251020121716390253%jimsgibson@gmail.com> References: <6c4cbf49-d97e-4bf8-9c8c-050943cf268d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net 9rKNrnjH/YorQco8NA0sWgfku4syPqmAN1nvt+fb8ySeP+CKkIedE8znWM/YQDjoXE X-Orig-Path: jimsgibson Cancel-Lock: sha1:KIvyEbDeGVoBJ52+xMJPZnz6z80= User-Agent: Thoth/1.9.0 (Mac OS X) Xref: csiph.com comp.lang.java.programmer:19507 In article <6c4cbf49-d97e-4bf8-9c8c-050943cf268d@googlegroups.com>, LMario wrote: > Somebody can help to me to rewrite to next CURL PHP code to Java > HTTPComponents: > > $process = curl_init('https://www.test.com/directory'); > curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', > 'charset=utf-8')); > curl_setopt($process, CURLOPT_POSTFIELDS, $sob->saveXML()); > curl_setopt($process, CURLOPT_SSLCERT, '123456789.cer'); > curl_setopt($process, CURLOPT_SSLCERTPASSWD, "123456789"); > curl_setopt($process, CURLOPT_RETURNTRANSFER, true); > curl_setopt($process, CURLOPT_POST, true); > curl_setopt($process, CURLOPT_SSL_VERIFYPEER, false); > curl_setopt($process, CURLOPT_SSL_VERIFYHOST, false); > $answer = curl_exec($process); > curl_close($process); If you google for "java curl", the first three hits are pretty much your question. No idea if the answers are any good. -- Jim Gibson