Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19507

Re: CURL-PHP to Java-HTTPComponents

From Jim Gibson <jimsgibson@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: CURL-PHP to Java-HTTPComponents
Date 2012-10-25 17:16 -0700
Message-ID <251020121716390253%jimsgibson@gmail.com> (permalink)
References <6c4cbf49-d97e-4bf8-9c8c-050943cf268d@googlegroups.com>

Show all headers | View raw


In article <6c4cbf49-d97e-4bf8-9c8c-050943cf268d@googlegroups.com>,
LMario <lefalme@gmail.com> 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

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

CURL-PHP to Java-HTTPComponents LMario <lefalme@gmail.com> - 2012-10-25 15:23 -0700
  Re: CURL-PHP to Java-HTTPComponents Jim Gibson <jimsgibson@gmail.com> - 2012-10-25 17:16 -0700
    Re: CURL-PHP to Java-HTTPComponents LMario <lefalme@gmail.com> - 2012-10-25 20:01 -0700
      Re: CURL-PHP to Java-HTTPComponents Joerg Meier <joergmmeier@arcor.de> - 2012-10-26 21:16 +0200

csiph-web