Skip to content

setCredentials doesn't work #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Code-Farmer-Ming opened this issue Jul 25, 2011 · 1 comment
Closed

setCredentials doesn't work #7

Code-Farmer-Ming opened this issue Jul 25, 2011 · 1 comment

Comments

@Code-Farmer-Ming
Copy link

AsyncHttpClient client = new AsyncHttpClient();

((DefaultHttpClient)client.getHttpClient()).getCredentialsProvider()
   .setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));

RequestParams params = new RequestParams();

 params.put("user[photo]", new File("pic.jpg")); // Upload a File

 client.post("http://myendpoint.com", params, null);

Getting A Response; Error 401

@lorthos
Copy link

lorthos commented Dec 10, 2011

how did you fixed this?
i am facing this issue with 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants