I attempt emigrate my HttpClient library by Apache from three.1 to 4.1.2. I am searching for the same as this in 4.1.2:

PostMethod method = new PostMethod(url);        
method.addParameter("login", login);   
method.addParameter("password", password);

I attempt this, however the server does not recognize the request :

HttpPost method = new HttpPost(url);   
MultipartEntity multipartEntity = new MultipartEntity(HttpMultipartMode.STRICT);
multipartEntity.addPart("login", new StringBody(login));
multipartEntity.addPart("password", new StringBody(password));

any ideas ?

Perhaps you have attempted just setting the parameters rather than developing a multipart request?

HttpParams params = new BasicHttpParams();
params.setParameter("login", login);   
params.setParameter("password", password);

HttpPost method = new HttpPost(url);