I am using Apache Commons HttpClient PostMethod 3.1.
In the PostMethod class there are also three methods for setting POST method\'s request body:
se
The javadoc says:
Deprecated. use setRequestEntity(RequestEntity)
RequestEntity has a lot of implementors, namely:
ByteArrayRequestEntity, FileRequestEntity, InputStreamRequestEntity, MultipartRequestEntity, StringRequestEntity
Use the one that suits you:
String
, use the StringRequestEntityand so on.
Yes, so for example,
post.setRequestEntity( new StringRequestEntity( xml ) );
instead of
post.setRequestBody( xml );