That's because what Mohamed is referring is the old (3.x) HttpClient
and not the new (4.x) one which have different (sometime very
different) API.
The main issue you have is probably the fact that XWiki does not ask
the client for credential by default since anonymous access is valid.
That means y
For some reasons it gives me this
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
at org.apache.commons.httpclient.HttpClient.(HttpClient.java:65)
at RestTest2.getClient(RestTest2.java:16)
at RestTest2.main(RestTest2.java:27)
Hi,
I forget to add the packages to import in my previous code.
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apac
Thank you for your response!
As far as I know there is no PutMethod (which you use in your code) class in
new versions of Apache's HTTP library. Same goes for many other methods
which.
Or maybe I'm just missing the point and there IS a library with required
Classes and Methods of which I know not
Hi,
You can use the new version of Apache's HTTP library, as follows, hope
it'll help you.
public class RestTest {
/**
* Create and initialize the http client.
*
* @return an HttpClient object
*/
HttpClient getClient(host, port, username, password) {
HttpClient httpClient