You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by X Gylee <x....@gmail.com> on 2007/09/19 04:23:58 UTC

How to do HTTP POST

Could somebody point me out how I can submit an HTTP POST to an external URL
from OFBiz?
Is this available as a type of event handler or should I do it manually in
my own class?

Many thanks.

Re: How to do HTTP POST

Posted by BJ Freeman <bj...@free-man.net>.
good example in the DHL integration.
org.ofbiz.shipment.thirdparty.dhl

 HttpClient http = new HttpClient(conStr);
        http.setTimeout(timeout * 1000);
        String response = null;
        try {
            response = http.post(xmlString);
        } catch (HttpClientException e) {
            Debug.logError(e, "Problem connecting with DHL server", module);
            throw new DhlConnectException("URL Connection problem", e);
        }


X Gylee sent the following on 9/18/2007 7:23 PM:
> Could somebody point me out how I can submit an HTTP POST to an external URL
> from OFBiz?
> Is this available as a type of event handler or should I do it manually in
> my own class?
> 
> Many thanks.
>