Java Doc for PostMethod.java in  » Net » Apache-common-HttpClient » org » apache » commons » httpclient » methods » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Apache common HttpClient » org.apache.commons.httpclient.methods 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.httpclient.methods.ExpectContinueMethod
   org.apache.commons.httpclient.methods.EntityEnclosingMethod
      org.apache.commons.httpclient.methods.PostMethod

All known Subclasses:   org.apache.commons.httpclient.NoncompliantPostMethod,
PostMethod
public class PostMethod extends EntityEnclosingMethod (Code)
Implements the HTTP POST method.

The HTTP POST method is defined in section 9.5 of RFC2616:

The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:
  • Annotation of existing resources
  • Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles
  • Providing a block of data, such as the result of submitting a form, to a data-handling process
  • Extending a database through an append operation


author:
   Remy Maucherat
author:
   Doug Sale
author:
   Jeff Dever
author:
   Ortwin Gl???ck
author:
   Mike Bowler
author:
   Oleg Kalnichevski
version:
   $Revision: 480424 $
since:
   1.0


Field Summary
final public static  StringFORM_URL_ENCODED_CONTENT_TYPE
     The Content-Type for www-form-urlencoded.

Constructor Summary
public  PostMethod()
     No-arg constructor.
public  PostMethod(String uri)
     Constructor specifying a URI.

Method Summary
public  voidaddParameter(String paramName, String paramValue)
     Adds a new parameter to be used in the POST request body.
public  voidaddParameter(NameValuePair param)
     Adds a new parameter to be used in the POST request body.
public  voidaddParameters(NameValuePair[] parameters)
     Adds an array of parameters to be used in the POST request body.
protected  voidclearRequestBody()
     Clears request body.
protected  RequestEntitygenerateRequestEntity()
     Generates a request entity from the post parameters, if present.
public  StringgetName()
     Returns "POST".
public  NameValuePairgetParameter(String paramName)
     Gets the parameter of the specified name.
public  NameValuePair[]getParameters()
     Gets the parameters currently added to the PostMethod.
protected  booleanhasRequestContent()
     Returns true if there is a request body to be sent.
public  booleanremoveParameter(String paramName)
     Removes all parameters with the given paramName.
public  booleanremoveParameter(String paramName, String paramValue)
     Removes all parameter with the given paramName and paramValue.
public  voidsetParameter(String parameterName, String parameterValue)
     Sets the value of parameter with parameterName to parameterValue.
public  voidsetRequestBody(NameValuePair[] parametersBody)
    

Field Detail
FORM_URL_ENCODED_CONTENT_TYPE
final public static String FORM_URL_ENCODED_CONTENT_TYPE(Code)
The Content-Type for www-form-urlencoded.




Constructor Detail
PostMethod
public PostMethod()(Code)
No-arg constructor.
since:
   1.0



PostMethod
public PostMethod(String uri)(Code)
Constructor specifying a URI.
Parameters:
  uri - either an absolute or relative URI
since:
   1.0




Method Detail
addParameter
public void addParameter(String paramName, String paramValue) throws IllegalArgumentException(Code)
Adds a new parameter to be used in the POST request body.
Parameters:
  paramName - The parameter name to add.
Parameters:
  paramValue - The parameter value to add.
throws:
  IllegalArgumentException - if either argument is null
since:
   1.0



addParameter
public void addParameter(NameValuePair param) throws IllegalArgumentException(Code)
Adds a new parameter to be used in the POST request body.
Parameters:
  param - The parameter to add.
throws:
  IllegalArgumentException - if the argument is null or containsnull values
since:
   2.0



addParameters
public void addParameters(NameValuePair[] parameters)(Code)
Adds an array of parameters to be used in the POST request body. Logs a warning if the parameters argument is null.
Parameters:
  parameters - The array of parameters to add.
since:
   2.0



clearRequestBody
protected void clearRequestBody()(Code)
Clears request body.

This method must be overwritten by sub-classes that implement alternative request content input methods


since:
   2.0beta1



generateRequestEntity
protected RequestEntity generateRequestEntity()(Code)
Generates a request entity from the post parameters, if present. Calls EntityEnclosingMethod.generateRequestBody if parameters have not been set.
since:
   3.0



getName
public String getName()(Code)
Returns "POST". "POST"
since:
   2.0



getParameter
public NameValuePair getParameter(String paramName)(Code)
Gets the parameter of the specified name. If there exists more than one parameter with the name paramName, then only the first one is returned.
Parameters:
  paramName - name of the parameter If a parameter exists with the name argument, the corespondingNameValuePair is returned. Otherwise null.
since:
   2.0



getParameters
public NameValuePair[] getParameters()(Code)
Gets the parameters currently added to the PostMethod. If there are no parameters, a valid array is returned with zero elements. The returned array object contains an array of pointers to the internal data members. An array of the current parameters
since:
   2.0



hasRequestContent
protected boolean hasRequestContent()(Code)
Returns true if there is a request body to be sent.

This method must be overwritten by sub-classes that implement alternative request content input methods

boolean
since:
   2.0beta1



removeParameter
public boolean removeParameter(String paramName) throws IllegalArgumentException(Code)
Removes all parameters with the given paramName. If there is more than one parameter with the given paramName, all of them are removed. If there is just one, it is removed. If there are none, then the request is ignored.
Parameters:
  paramName - The parameter name to remove. true if at least one parameter was removed
throws:
  IllegalArgumentException - When the parameter name passed is null
since:
   2.0



removeParameter
public boolean removeParameter(String paramName, String paramValue) throws IllegalArgumentException(Code)
Removes all parameter with the given paramName and paramValue. If there is more than one parameter with the given paramName, only one is removed. If there are none, then the request is ignored.
Parameters:
  paramName - The parameter name to remove.
Parameters:
  paramValue - The parameter value to remove. true if a parameter was removed.
throws:
  IllegalArgumentException - when param name or value are null
since:
   2.0



setParameter
public void setParameter(String parameterName, String parameterValue)(Code)
Sets the value of parameter with parameterName to parameterValue. This method does not preserve the initial insertion order.
Parameters:
  parameterName - name of the parameter
Parameters:
  parameterValue - value of the parameter
since:
   2.0



setRequestBody
public void setRequestBody(NameValuePair[] parametersBody) throws IllegalArgumentException(Code)
Sets an array of parameters to be used in the POST request body
Parameters:
  parametersBody - The array of parameters to add.
throws:
  IllegalArgumentException - when param parameters are null
since:
   2.0beta1



Fields inherited from org.apache.commons.httpclient.methods.EntityEnclosingMethod
final public static long CONTENT_LENGTH_AUTO(Code)(Java Doc)
final public static long CONTENT_LENGTH_CHUNKED(Code)(Java Doc)

Methods inherited from org.apache.commons.httpclient.methods.EntityEnclosingMethod
protected void addContentLengthRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc)
protected void addRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc)
protected void clearRequestBody()(Code)(Java Doc)
protected byte[] generateRequestBody()(Code)(Java Doc)
protected RequestEntity generateRequestEntity()(Code)(Java Doc)
public boolean getFollowRedirects()(Code)(Java Doc)
public String getRequestCharSet()(Code)(Java Doc)
protected long getRequestContentLength()(Code)(Java Doc)
public RequestEntity getRequestEntity()(Code)(Java Doc)
protected boolean hasRequestContent()(Code)(Java Doc)
public void recycle()(Code)(Java Doc)
public void setContentChunked(boolean chunked)(Code)(Java Doc)
public void setFollowRedirects(boolean followRedirects)(Code)(Java Doc)
public void setRequestBody(InputStream body)(Code)(Java Doc)
public void setRequestBody(String body)(Code)(Java Doc)
public void setRequestContentLength(int length)(Code)(Java Doc)
public void setRequestContentLength(long length)(Code)(Java Doc)
public void setRequestEntity(RequestEntity requestEntity)(Code)(Java Doc)
protected boolean writeRequestBody(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc)

Methods inherited from org.apache.commons.httpclient.methods.ExpectContinueMethod
protected void addRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException(Code)(Java Doc)
public boolean getUseExpectHeader()(Code)(Java Doc)
abstract protected boolean hasRequestContent()(Code)(Java Doc)
public void setUseExpectHeader(boolean value)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.