How to do HTTP POST

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to do HTTP POST

X Gylee
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.
Reply | Threaded
Open this post in threaded view
|

Re: How to do HTTP POST

BJ Freeman
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.
>