org.edg.security.httpclient
Class PostBody

java.lang.Object
  |
  +--org.edg.security.httpclient.PostBody

public class PostBody
extends java.lang.Object

Class used to store the optional parameters to be included in the request when using POST or PUT connection method.

Author:
Gian Luca Volpato

Constructor Summary
PostBody()
          Constructs a PostBody object.
 
Method Summary
 java.lang.Object get(java.lang.String key)
          Returns the value associated to the given key.
 void setBody(java.lang.String body)
          Sets the body of the data to be sent to the server.
 void setContentType(java.lang.String contentType)
          Sets the content-type of the data to be sent to the server.
 void setForms(java.lang.String name, java.lang.String value)
          Adds a name-value pair to the HTML FORM parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostBody

public PostBody()
Constructs a PostBody object. The object may contain parameters specific for POST or PUT requests, like content-type, body data and HTML FORM.

Method Detail

setContentType

public void setContentType(java.lang.String contentType)
Sets the content-type of the data to be sent to the server.

Parameters:
contentType - the type of data to be sent

setBody

public void setBody(java.lang.String body)
Sets the body of the data to be sent to the server. Body can be a String or the name of the file containing the actual body data.

Parameters:
body - the body of the data or the name of the file containing the body of the data

setForms

public void setForms(java.lang.String name,
                     java.lang.String value)
Adds a name-value pair to the HTML FORM parameters. Can be called several times to add several pairs.

Parameters:
name - the name of the FORM parameter
value - the value of the FORM parameter

get

public java.lang.Object get(java.lang.String key)
Returns the value associated to the given key.

Parameters:
key - the key identifing an object
Returns:
Object the value associated to the given key