Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.twitterapime.io
Class HttpRequest

    java.lang.Object
      com.twitterapime.io.HttpRequest

    public final class HttpRequest

extends java.lang.Object

This class implements a Http request.

Since:
  1.3
Version:
  1.0
Author:
  Ernandes Mourao Junior (ernandes@gmail.com)

Constructor Summary
`HttpRequest(java.lang.String url)` Create an instance of HttpRequest class.

Method Summary
`void` | `close()` Close the request object connection.
`java.util.Hashtable` | `getBodyParameters()` Get body parameters.
`java.util.Hashtable` | `getHeaderFields()` Get header fields.
`java.lang.String` | `getMethod()` Get Http method.
`java.lang.String` | `getQueryString()` Get URL's query string.
`java.util.Hashtable` | `getQueryStringParams()` Get URL's query string parameters.
`java.lang.String` | `getSanitizedURL()` Get sanitized URL.
`java.lang.String` | `getURL()` Get URL.
`HttpResponse` | `send()` Send a given to the URL.
`void` | `setBodyParameter(java.lang.String key, java.lang.String value)` Set a body parameter value.
`void` | `setHeaderField(java.lang.String key, java.lang.String value)` Set a header field's value.
`void` | `setMethod(java.lang.String method)` Set Http method.
`void` | `setSigner(XAuthSigner signer, Token token)` Set xAuth signer and access token.

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

Constructor Detail

### HttpRequest

    public HttpRequest(java.lang.String url)

  Create an instance of HttpRequest class.

  Parameters:
    `url` - URL.
  Throws:
    `java.lang.IllegalArgumentException` - If URL is empty or null.

Method Detail

### send

    public HttpResponse send()
                      throws java.io.IOException

  Send a given to the URL.

  Returns:
    Http response object.
  Throws:
    `java.io.IOException` - If an I/O error occurs.

### close

    public void close()
               throws java.io.IOException

  Close the request object connection.

  Throws:
    `java.io.IOException` - If an I/O error occurs.

### setHeaderField

    public void setHeaderField(java.lang.String key,
                               java.lang.String value)

  Set a header field's value.

  Parameters:
    `key` - Field key.
    `value` - Field value.

### setBodyParameter

    public void setBodyParameter(java.lang.String key,
                                 java.lang.String value)

  Set a body parameter value.

  Parameters:
    `key` - Paramenter key.
    `value` - Parameter value.

### getHeaderFields

    public java.util.Hashtable getHeaderFields()

  Get header fields.

  Returns:
    Fields.

### setMethod

    public void setMethod(java.lang.String method)

  Set Http method.

  Parameters:
    `method` - Method.
  Throws:
    `java.lang.IllegalArgumentException` - If method is invalid.
  See Also:
    `HttpConnection.GET`, `HttpConnection.POST`

### getBodyParameters

    public java.util.Hashtable getBodyParameters()

  Get body parameters.

  Returns:
    Parameters.

### getQueryStringParams

    public java.util.Hashtable getQueryStringParams()

  Get URL's query string parameters.

  Returns:
    Parameters.

### getURL

    public java.lang.String getURL()

  Get URL.

  Returns:
    URL.

### getMethod

    public java.lang.String getMethod()

  Get Http method.

  Returns:
    Method.

### getSanitizedURL

    public java.lang.String getSanitizedURL()

  Get sanitized URL.

  Returns:
    URL.

### getQueryString

    public java.lang.String getQueryString()

  Get URL's query string.

  Returns:
    Query string.

### setSigner

    public void setSigner(XAuthSigner signer,
                          Token token)

  Set xAuth signer and access token.

  Parameters:
    `signer` - Signer.
    `token` - Access token.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Twitter API ME Team. All Rights Reserved.