Skip to content

Commit 977bf3c

Browse files
committed
Move basic auth docs
1 parent d305749 commit 977bf3c

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -197,28 +197,6 @@ RequestParams params = new RequestParams(paramMap);
197197
See the [RequestParams Javadoc](http://loopj.com/android-async-http/doc/com/loopj/android/http/RequestParams.html)
198198
for more information.
199199

200-
Adding HTTP Basic Auth credentials
201-
------------------------------------
202-
Some requests may need username/password credentials when dealing with API services that use HTTP Basic Access Authentication requests.
203-
You can use the method `setBasicAuth()` to provide your credentials.
204-
205-
Set username/password for any host and realm for a particular request. By default the Authentication Scope is for any host, port and realm.
206-
{% highlight java %}
207-
AsyncHttpClient client = new AsyncHttpClient();
208-
client.setBasicAuth("username","password/token");
209-
client.get("http://example.com".....); //etc.
210-
{% endhighlight %}
211-
212-
You can also provide a more specific Authentication Scope (recommended)
213-
{% highlight java %}
214-
AsyncHttpClient client = new AsyncHttpClient();
215-
client.setBasicAuth("username","password", new AuthScope("example.com",80, AuthScope.ANY_REALM));
216-
client.get("http://example.com".....); //etc.
217-
{% endhighlight %}
218-
219-
See the [RequestParams Javadoc](http://loopj.com/android-async-http/doc/com/loopj/android/http/AsyncHttpClient.html)
220-
for more information.
221-
222200
Uploading Files with `RequestParams`
223201
------------------------------------
224202
The `RequestParams` class additionally supports multipart file uploads as
@@ -269,6 +247,28 @@ client.get("http://example.com/file.png", new BinaryHttpResponseHandler(allowedC
269247
See the [BinaryHttpResponseHandler Javadoc](http://loopj.com/android-async-http/doc/com/loopj/android/http/BinaryHttpResponseHandler.html)
270248
for more information.
271249

250+
Adding HTTP Basic Auth credentials
251+
------------------------------------
252+
Some requests may need username/password credentials when dealing with API services that use HTTP Basic Access Authentication requests.
253+
You can use the method `setBasicAuth()` to provide your credentials.
254+
255+
Set username/password for any host and realm for a particular request. By default the Authentication Scope is for any host, port and realm.
256+
{% highlight java %}
257+
AsyncHttpClient client = new AsyncHttpClient();
258+
client.setBasicAuth("username","password/token");
259+
client.get("http://example.com".....); //etc.
260+
{% endhighlight %}
261+
262+
You can also provide a more specific Authentication Scope (recommended)
263+
{% highlight java %}
264+
AsyncHttpClient client = new AsyncHttpClient();
265+
client.setBasicAuth("username","password", new AuthScope("example.com",80, AuthScope.ANY_REALM));
266+
client.get("http://example.com".....); //etc.
267+
{% endhighlight %}
268+
269+
See the [RequestParams Javadoc](http://loopj.com/android-async-http/doc/com/loopj/android/http/AsyncHttpClient.html)
270+
for more information.
271+
272272
Building from Source
273273
--------------------
274274
To build a `.jar` file from source, first make a clone of the

0 commit comments

Comments
 (0)