Skip navigation links

Oracle® On Track Communication SDK Documentation
Release 1(1.0)

E20955-01


waggle.core.http
Class XHTTPMethod

java.lang.Object
  extended by waggle.core.http.XHTTPMethod


public final class XHTTPMethod
extends Object

Execute an HTTP method.


Method Summary
 void abort()
          Abort a request.
 void close()
          Close the current request.
 XHTTPStatus get(String queryString)
          Get with the specified query string.
 XHTTPStatus get(String queryString, List<XHTTPHeader> headers)
          Get with the specified query string.
 byte[] getResponseBody()
          Read the response body as a byte array.
 InputStream getResponseBodyAsStream()
          Read the response body as an InputStream.
 String getResponseBodyAsString()
          Read the response body as a String.
 String getResponseContentEncoding()
          Get the response content encoding.
 int getResponseContentLength()
          Get the response content length.
 String getResponseContentType()
          Get the response content type.
 String getResponseHeader(String name)
          Get a response header.
 XHTTPStatus post(List<XHTTPHeader> headers, InputStream inputStream, String mimeType, String queryString)
          Post an InputStream.
 XHTTPStatus post(List<XHTTPHeader> headers, List<XHTTPPart> partValues)
          Post some parts.
 XHTTPStatus post(List<XHTTPHeader> headers, String content, String mimeType)
          Post a String.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

abort

public void abort()
Abort a request.

post

public XHTTPStatus post(List<XHTTPHeader> headers,
                        List<XHTTPPart> partValues)
Post some parts.
Parameters:
headers - Any headers or null.
partValues - Any parts.
Returns:
The return status.

post

public XHTTPStatus post(List<XHTTPHeader> headers,
                        InputStream inputStream,
                        String mimeType,
                        String queryString)
Post an InputStream.
Parameters:
headers - Any headers or null.
inputStream - The Body as an InputStream.
mimeType - The Body mime type.
queryString - Any query string.
Returns:
The return status.

post

public XHTTPStatus post(List<XHTTPHeader> headers,
                        String content,
                        String mimeType)
Post a String.
Parameters:
headers - Any headers.
content - The content to post.
mimeType - The content mime type.
Returns:
The return status.

get

public XHTTPStatus get(String queryString)
Get with the specified query string.
Parameters:
queryString - The query string.
Returns:
The return status.

get

public XHTTPStatus get(String queryString,
                       List<XHTTPHeader> headers)
Get with the specified query string.
Parameters:
queryString - The query string.
headers - Any headers or null.
Returns:
The return status.

close

public void close()
Close the current request.

getResponseContentLength

public int getResponseContentLength()
Get the response content length.
Returns:
The response content length.

getResponseContentType

public String getResponseContentType()
Get the response content type.
Returns:
The response content type.

getResponseContentEncoding

public String getResponseContentEncoding()
Get the response content encoding.
Returns:
The response content encoding.

getResponseHeader

public String getResponseHeader(String name)
Get a response header.
Parameters:
name - The header name.
Returns:
The header value.

getResponseBody

public byte[] getResponseBody()
                       throws IOException
Read the response body as a byte array.
Returns:
The byte array.
Throws:
IOException - IO problems.

getResponseBodyAsStream

public InputStream getResponseBodyAsStream()
Read the response body as an InputStream.
Returns:
The response body InputStream.

getResponseBodyAsString

public String getResponseBodyAsString()
Read the response body as a String.
Returns:
The response body as a String.

Skip navigation links

Oracle® On Track Communication SDK Documentation
Release 1(1.0)

E20955-01


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.