com.planeth.common.helper
Class HttpHelper

java.lang.Object
  extended bycom.planeth.common.helper.HttpHelper

public class HttpHelper
extends java.lang.Object

Helper to handle HttpRequests

Author:
Andreas Grässer, gal@planet-h.com.
created 07.11.2005

Constructor Summary
HttpHelper()
           
 
Method Summary
static java.lang.String getRequest(java.lang.String urlStr)
          Http GET request
static org.w3c.dom.Document getXml(java.lang.String urlStr)
          Request a XmlDocument over a Get Request
static java.lang.String postRequest(java.lang.String urlStr, java.lang.String data)
          Http POST request
static org.w3c.dom.Document postXml(java.lang.String urlStr, org.w3c.dom.Document document)
          Sends the content of an XmlDocument to an Url and requests it after the send is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpHelper

public HttpHelper()
Method Detail

getRequest

public static java.lang.String getRequest(java.lang.String urlStr)
Http GET request

Parameters:
urlStr - Url where the request has to send
Returns:
The content (String) of the HttpResponse

postRequest

public static java.lang.String postRequest(java.lang.String urlStr,
                                           java.lang.String data)
Http POST request

Parameters:
urlStr - Url where the request has to send
data - Data to be sent
Returns:
The content (String) of the HttpResponse

getXml

public static org.w3c.dom.Document getXml(java.lang.String urlStr)
Request a XmlDocument over a Get Request

Parameters:
urlStr - Url where the request has to send
Returns:
The resulting XmlDocument

postXml

public static org.w3c.dom.Document postXml(java.lang.String urlStr,
                                           org.w3c.dom.Document document)
Sends the content of an XmlDocument to an Url and requests it after the send is complete.
This is only possible, if the requested Url supports sending and requesting.

Parameters:
urlStr - Url where the request has to send
document - XmlDocument to be sent
Returns:
The resulting XmlDocument